lkml.org 
[lkml]   [2002]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: compile the kernel with -Werror
A full kernel compilation, especially when using the -j switch to
make, can cause warnings to "fly off the screen" without the user
noticing them. For example, wli's patch lazy_buddy.2.5.25-1 of today
had a missing return statement in a function returning non void, which
the compiler probably complained about but the warning got lost in the
noise (a little birdie told me wli used -j64).

The easiest safeguard agsinst this kind of problems is to compile with
-Werror, so that wherever there's a warning, compilation
stops. Compiling 2.5.25 with -Werror with my .config found only three
warnings (quite impressive, IMHO), and patches for those were sent to
trivial@rusty.

Patch against 2.5.25 to add -Werror attached:

--- linux-2.5.25-vanilla/Makefile Sat Jul 6 02:42:04 2002
+++ linux-2.5.25-mx/Makefile Sat Jul 13 10:01:55 2002
@@ -39,7 +39,7 @@
FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net

HOSTCC = gcc
-HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer

CROSS_COMPILE =

@@ -211,7 +211,7 @@

CPPFLAGS := -D__KERNEL__ -I$(HPATH)

-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+CFLAGS := $(CPPFLAGS) -Wall -Werror -Wstrict-prototypes -Wno-trigraphs -O2 \
-fomit-frame-pointer -fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)

--
http://vipe.technion.ac.il/~mulix/
http://syscalltrack.sf.net/[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:27    [W:0.078 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site