X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=Makefile;h=dc907f6a81e55e9738402d431495ceca9c5fab10;hp=052e41acc3f87deea2e0b81a6cdb42eb31fe5796;hb=3a030b511f74348a67c413858713c6fe9c85605c;hpb=045b1f0f7a7af2182e7109f472d873f1cc0c5e4b diff --git a/Makefile b/Makefile index 052e41acc..dc907f6a8 100644 --- 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