]> granicus.if.org Git - nethack/commitdiff
distinguish compiler version before adding new -Wno option
authornhmall <nhmall@nethack.org>
Mon, 10 Aug 2020 14:03:12 +0000 (10:03 -0400)
committernhmall <nhmall@nethack.org>
Mon, 10 Aug 2020 14:03:12 +0000 (10:03 -0400)
sys/unix/hints/linux.2020

index 5371c0c839c82da6ac2c9569b3d43133691a1fc6..7d19ddc04dad5d3552721ea5a6870d7de4e7154a 100755 (executable)
@@ -132,7 +132,10 @@ endif
 endif
 
 CFLAGS=-g -O -I../include -DNOTPARMDECL
+GTEQ9 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 9)
+ifeq "$(GTEQ9)" "1"
 CFLAGS+=-Wno-format-overflow
+endif  #compiler version greater than or equal to 9
 CFLAGS+=-DDLB
 CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
 CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE