public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add -Wun-def to global CFLAGS
@ 2005-07-21 19:02 Olaf Hering
  2005-07-21 21:47 ` Sam Ravnborg
  2005-07-22 14:48 ` [PATCH] turn many #if $undefined_string into #ifdef $undefined_string Olaf Hering
  0 siblings, 2 replies; 3+ messages in thread
From: Olaf Hering @ 2005-07-21 19:02 UTC (permalink / raw)
  To: Andrew Morton, Sam Ravnborg, linux-kernel


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 <olh@suse.de>

 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.12.aic-fixing/Makefile
===================================================================
--- linux-2.6.12.aic-fixing.orig/Makefile
+++ linux-2.6.12.aic-fixing/Makefile
@@ -203,7 +203,7 @@ CONFIG_SHELL := $(shell if [ -x "$$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__

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-22 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-21 19:02 [PATCH] add -Wun-def to global CFLAGS Olaf Hering
2005-07-21 21:47 ` Sam Ravnborg
2005-07-22 14:48 ` [PATCH] turn many #if $undefined_string into #ifdef $undefined_string Olaf Hering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox