Re: [PATCH] add -Wun-def to global CFLAGS

2005-07-21 Thread Sam Ravnborg
On Thu, Jul 21, 2005 at 09:02:09PM +0200, Olaf Hering wrote:
> 
> 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.

To my suprise it did not spew out a lot of warnings in my build.
In the kernel we quite consitently use ??#ifdef - good!
Applied.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] add -Wun-def to global CFLAGS

2005-07-21 Thread Olaf Hering

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 <[EMAIL PROTECTED]>

 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__
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] add -Wun-def to global CFLAGS

2005-07-21 Thread Olaf Hering

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 [EMAIL PROTECTED]

 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__
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] add -Wun-def to global CFLAGS

2005-07-21 Thread Sam Ravnborg
On Thu, Jul 21, 2005 at 09:02:09PM +0200, Olaf Hering wrote:
 
 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.

To my suprise it did not spew out a lot of warnings in my build.
In the kernel we quite consitently use ??#ifdef - good!
Applied.

Sam
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/