From: Olaf Hering Date: Thu, 21 Jul 2005 19:02:09 +0000 (+0200) Subject: [PATCH] kbuild: add -Wundef to global CFLAGS X-Git-Tag: v2.6.14-rc1~750^2~18 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c521e06fad4b4b7fe4811fb8363d12cf49f40a2;p=linux-2.6 [PATCH] kbuild: add -Wundef to global CFLAGS A recent change to the aic scsi driver removed two defines to detect endianness. cpp handles undefined strings as 0. As a result, the test turned into #if 0 == 0 and the wrong code was selected. Adding -Wundef to global CFLAGS will catch such errors. Signed-off-by: Olaf Hering Signed-off-by: Sam Ravnborg --- diff --git a/Makefile b/Makefile index 5185c91707..423397f039 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ HOSTCC = gcc HOSTCXX = g++ -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +HOSTCFLAGS = -Wall -Wundef -Wstrict-prototypes -O2 -fomit-frame-pointer HOSTCXXFLAGS = -O2 # Decide whether to build built-in, modular, or both. @@ -348,7 +348,7 @@ LINUXINCLUDE := -Iinclude \ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) -CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ +CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \ -ffreestanding AFLAGS := -D__ASSEMBLY__