chiark / gitweb /
[PATCH] Makefile: add some more warnings and prepare for clean gcc4 compile
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Sat, 5 Feb 2005 01:44:37 +0000 (02:44 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 06:24:19 +0000 (23:24 -0700)
Makefile
extras/volume_id/Makefile

index 052e41a..dc907f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -108,8 +108,12 @@ GCC_LIB := $(shell $(CC) -print-libgcc-file-name )
 OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
                then echo "-Os"; else echo "-O2" ; fi}
 
-# add -Wredundant-decls when libsysfs gets cleaned up
-WARNINGS := -Wall 
+# check if compiler option is supported
+cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
+
+WARNINGS := -Wall -fno-builtin -Wchar-subscripts -Wpointer-arith -Wstrict-prototypes -Wsign-compare
+WARNINGS += $(call cc-supports,-Wno-pointer-sign)
+WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
 
 CFLAGS := -pipe
 
index f0c15b8..d273ed7 100644 (file)
@@ -28,9 +28,6 @@ INSTALL_PROGRAM = ${INSTALL}
 INSTALL_DATA  = ${INSTALL} -m 644
 INSTALL_SCRIPT = ${INSTALL_PROGRAM}
 
-override CFLAGS+=-Wall -fno-builtin -Wchar-subscripts \
-                -Wpointer-arith -Wcast-align -Wsign-compare
-
 override CFLAGS+=-D_FILE_OFFSET_BITS=64
 
 VOLUME_ID_OBJS=                                        \