* PATCH: compile the kernel with -Werror
@ 2002-07-13 7:26 Muli Ben-Yehuda
2002-07-13 8:02 ` Zwane Mwaikambo
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Muli Ben-Yehuda @ 2002-07-13 7:26 UTC (permalink / raw)
To: Linus Torvalds; +Cc: William Lee Irwin III, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1512 bytes --]
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/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 8:02 ` Zwane Mwaikambo
@ 2002-07-13 7:43 ` Muli Ben-Yehuda
2002-07-13 14:49 ` Thunder from the hill
0 siblings, 1 reply; 13+ messages in thread
From: Muli Ben-Yehuda @ 2002-07-13 7:43 UTC (permalink / raw)
To: Zwane Mwaikambo; +Cc: Linus Torvalds, William Lee Irwin III, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 554 bytes --]
On Sat, Jul 13, 2002 at 10:02:19AM +0200, Zwane Mwaikambo wrote:
> On Sat, 13 Jul 2002, Muli Ben-Yehuda wrote:
>
> > 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.
>
> You need to add more drivers to your config ;)
I'm doing something better - make allyesconfig, minus things like
intermezzo which are totally broken in 2.5.25.
Next up: -pedantic ;)
--
http://vipe.technion.ac.il/~mulix/
http://syscalltrack.sf.net/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 7:26 PATCH: compile the kernel with -Werror Muli Ben-Yehuda
@ 2002-07-13 8:02 ` Zwane Mwaikambo
2002-07-13 7:43 ` Muli Ben-Yehuda
2002-07-13 8:17 ` Mike Galbraith
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Zwane Mwaikambo @ 2002-07-13 8:02 UTC (permalink / raw)
To: Muli Ben-Yehuda; +Cc: Linus Torvalds, William Lee Irwin III, linux-kernel
On Sat, 13 Jul 2002, Muli Ben-Yehuda wrote:
> 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.
You need to add more drivers to your config ;)
Cheers,
Zwane
--
function.linuxpower.ca
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 7:26 PATCH: compile the kernel with -Werror Muli Ben-Yehuda
2002-07-13 8:02 ` Zwane Mwaikambo
@ 2002-07-13 8:17 ` Mike Galbraith
2002-07-13 13:10 ` Kenneth Johansson
` (2 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Mike Galbraith @ 2002-07-13 8:17 UTC (permalink / raw)
To: Muli Ben-Yehuda, Linus Torvalds; +Cc: William Lee Irwin III, linux-kernel
At 10:26 AM 7/13/2002 +0300, Muli Ben-Yehuda wrote:
>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.
If you put -Werror in the stock flags, things like gcc warning that feature-foo
will go away someday becomes deadly.. bad idea IMO.
If people are building kernels (or anything else) and not making/checking
logs, they're wrong.
-Mike
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 7:26 PATCH: compile the kernel with -Werror Muli Ben-Yehuda
2002-07-13 8:02 ` Zwane Mwaikambo
2002-07-13 8:17 ` Mike Galbraith
@ 2002-07-13 13:10 ` Kenneth Johansson
2002-07-13 13:41 ` Roy Sigurd Karlsbakk
2002-07-13 14:24 ` Alan Cox
4 siblings, 0 replies; 13+ messages in thread
From: Kenneth Johansson @ 2002-07-13 13:10 UTC (permalink / raw)
To: Muli Ben-Yehuda; +Cc: Linus Torvalds, William Lee Irwin III, linux-kernel
On Sat, 2002-07-13 at 09:26, Muli Ben-Yehuda wrote:
> 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).
use
make -j64 KBUILD_VERBOSE=0
This is similar to what kbuils2.5 dose by default but since the in
kernel version do not have one single makefile the output gets a bit
reshuffled.
But -j64 dose seem a but hi I usually use the same as numbers of cpu.
over nfs I go a little higher.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 14:24 ` Alan Cox
@ 2002-07-13 13:34 ` William Lee Irwin III
2002-07-13 18:46 ` Linus Torvalds
1 sibling, 0 replies; 13+ messages in thread
From: William Lee Irwin III @ 2002-07-13 13:34 UTC (permalink / raw)
To: Alan Cox; +Cc: Muli Ben-Yehuda, Linus Torvalds, linux-kernel
On Sat, 2002-07-13 at 08:26, Muli Ben-Yehuda wrote:
>> 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.
On Sat, Jul 13, 2002 at 03:24:03PM +0100, Alan Cox wrote:
> May I suggest the user learns to use the command line properly. Adding
> -Werror doesn't help because gcc emits far too many bogus warnings for
> that.
This is not my favorite motive for -Werror. I prefer the "force people
to write cleaner code" aspect of it, but gcc's warnings are evil...
Cheers,
Bill
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 7:26 PATCH: compile the kernel with -Werror Muli Ben-Yehuda
` (2 preceding siblings ...)
2002-07-13 13:10 ` Kenneth Johansson
@ 2002-07-13 13:41 ` Roy Sigurd Karlsbakk
2002-07-13 14:59 ` Alan Cox
2002-07-16 20:36 ` James Antill
2002-07-13 14:24 ` Alan Cox
4 siblings, 2 replies; 13+ messages in thread
From: Roy Sigurd Karlsbakk @ 2002-07-13 13:41 UTC (permalink / raw)
To: Muli Ben-Yehuda, Linus Torvalds; +Cc: William Lee Irwin III, linux-kernel
On Saturday 13 July 2002 09:26, Muli Ben-Yehuda wrote:
> 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).
Why not add a menu item under kernel hacking?
roy
--
Roy Sigurd Karlsbakk, Datavaktmester
Computers are like air conditioners.
They stop working when you open Windows.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 7:26 PATCH: compile the kernel with -Werror Muli Ben-Yehuda
` (3 preceding siblings ...)
2002-07-13 13:41 ` Roy Sigurd Karlsbakk
@ 2002-07-13 14:24 ` Alan Cox
2002-07-13 13:34 ` William Lee Irwin III
2002-07-13 18:46 ` Linus Torvalds
4 siblings, 2 replies; 13+ messages in thread
From: Alan Cox @ 2002-07-13 14:24 UTC (permalink / raw)
To: Muli Ben-Yehuda; +Cc: Linus Torvalds, William Lee Irwin III, linux-kernel
On Sat, 2002-07-13 at 08:26, Muli Ben-Yehuda wrote:
> 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.
May I suggest the user learns to use the command line properly. Adding
-Werror doesn't help because gcc emits far too many bogus warnings for
that.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 7:43 ` Muli Ben-Yehuda
@ 2002-07-13 14:49 ` Thunder from the hill
0 siblings, 0 replies; 13+ messages in thread
From: Thunder from the hill @ 2002-07-13 14:49 UTC (permalink / raw)
To: Muli Ben-Yehuda
Cc: Zwane Mwaikambo, Linus Torvalds, William Lee Irwin III,
linux-kernel
Hi,
On Sat, 13 Jul 2002, Muli Ben-Yehuda wrote:
> I'm doing something better - make allyesconfig, minus things like
> intermezzo which are totally broken in 2.5.25.
Intermezzo _compiles_ just fine for me.
Regards,
Thunder
--
(Use http://www.ebb.org/ungeek if you can't decode)
------BEGIN GEEK CODE BLOCK------
Version: 3.12
GCS/E/G/S/AT d- s++:-- a? C++$ ULAVHI++++$ P++$ L++++(+++++)$ E W-$
N--- o? K? w-- O- M V$ PS+ PE- Y- PGP+ t+ 5+ X+ R- !tv b++ DI? !D G
e++++ h* r--- y-
------END GEEK CODE BLOCK------
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 13:41 ` Roy Sigurd Karlsbakk
@ 2002-07-13 14:59 ` Alan Cox
2002-07-16 20:36 ` James Antill
1 sibling, 0 replies; 13+ messages in thread
From: Alan Cox @ 2002-07-13 14:59 UTC (permalink / raw)
To: Roy Sigurd Karlsbakk
Cc: Muli Ben-Yehuda, Linus Torvalds, William Lee Irwin III,
linux-kernel
On Sat, 2002-07-13 at 14:41, Roy Sigurd Karlsbakk wrote:
> Why not add a menu item under kernel hacking?
CONFIG_TEACH_USER_TO_USE_GREP
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 14:24 ` Alan Cox
2002-07-13 13:34 ` William Lee Irwin III
@ 2002-07-13 18:46 ` Linus Torvalds
1 sibling, 0 replies; 13+ messages in thread
From: Linus Torvalds @ 2002-07-13 18:46 UTC (permalink / raw)
To: Alan Cox; +Cc: Muli Ben-Yehuda, William Lee Irwin III, linux-kernel
On 13 Jul 2002, Alan Cox wrote:
>
> May I suggest the user learns to use the command line properly. Adding
> -Werror doesn't help because gcc emits far too many bogus warnings for
> that.
Especially _some_ versions of gcc.
We've tried this before, and there are versions of gcc that have some
warnings on by default that simply aren't acceptable and cannot be avoided
sanely (I think at least some snapshots had the sign warnings on, for
example, which causes some really silly warnings where the warnings are
less odious than the changes required to get rid of them).
That said, I don't think -Werror is really wrong. It might make it less
likely to have new drivers introducing unnecessary warnings..
Linus
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
@ 2002-07-13 21:31 Dan Kegel
0 siblings, 0 replies; 13+ messages in thread
From: Dan Kegel @ 2002-07-13 21:31 UTC (permalink / raw)
To: linux-kernel
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Sat, 2002-07-13 at 14:41, Roy Sigurd Karlsbakk wrote:
>> Why not add a menu item under kernel hacking?
>
> CONFIG_TEACH_USER_TO_USE_GREP
It's a bit challenging to grep for errors in gcc's output, as
gcc produces multiline errors and warnings.
Here's a perl script I whipped up yesterday to filter out
all but the errors and warnings from a make + gcc run
for some other project; it'd probably do nicely on kernel
builds. I use it like this:
make > log 2>&1
errfilter.pl log | more
It has the dubious feature that it properly filters out the
warnings gcc produces on .h files that don't end in newlines
(guess what IDE people use here?)
- Dan
--- errfilter.pl ---
#!/usr/bin/perl
# Filter out all but essential lines of the output of a make + gcc run.
# Dan Kegel dkegel@ixiacom.com 12 July 2002
# Join logical lines which have been split into multiple physical lines
while (<>) {
chop;
if (/^\S/) {
&save($linebuf);
$linebuf = "";
}
$linebuf .= $_;
}
# Force blank lines at end
&save($linebuf);
&save("");
# Handle next logical line. Handle lines of context, like 'Entering directory', properly.
sub save
{
my($buf) = $_[0];
# Remove excess space used at beginning of all but first physical
# of a long logical line.
$buf =~ s/ */ /g;
if ($buf =~ /In file included from/) {
# Handle include context.
$prefix = $buf."\n";
} elsif ($buf =~ /Entering directory/) {
# Handle directory context.
unshift(@dir, $buf."\n");
$curdir = $dir[0];
} elsif ($buf =~ /Leaving directory/) {
# Handle directory context.
shift(@dir);
$curdir = $dir[0];
} else {
# Handle possible error lines.
if (&filter($buf)) {
# It's an error. Print it out with its context.
print $curdir.$prefix.$buf;
print "\n";
# Dir context only gets printed out once per directory change.
$curdir = "";
}
# Include context only gets printed out for immediately following line.
$prefix = "";
}
}
# Return true if given logical line contains a gcc error or warning and has not been seen before
sub filter
{
my($line) = $_[0];
if ($line =~ /:.*:/) {
if ($line !~ /treated|sed.*\.d|no newline at end|warning: overriding commands|warning: ignoring old commands|File format not recognized/) {
# uniq
if ($out{$line} == 0) {
$out{$line}++;
return 1;
}
}
}
return 0;
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PATCH: compile the kernel with -Werror
2002-07-13 13:41 ` Roy Sigurd Karlsbakk
2002-07-13 14:59 ` Alan Cox
@ 2002-07-16 20:36 ` James Antill
1 sibling, 0 replies; 13+ messages in thread
From: James Antill @ 2002-07-16 20:36 UTC (permalink / raw)
To: Roy Sigurd Karlsbakk; +Cc: Muli Ben-Yehuda, William Lee Irwin III, linux-kernel
Roy Sigurd Karlsbakk <roy@karlsbakk.net> writes:
> On Saturday 13 July 2002 09:26, Muli Ben-Yehuda wrote:
> > 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).
>
> Why not add a menu item under kernel hacking?
FFS....
make bzImage > compile.log 2> errors.log
--
James Antill -- james@and.org
"Although I have found authors who assert that the use of internal loop exits
is wrong, I have encountered none that support their claims with objective
evidence." -- Eric S. Roberts, Loop Exits and Structured Programming
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2002-07-16 20:36 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-13 7:26 PATCH: compile the kernel with -Werror Muli Ben-Yehuda
2002-07-13 8:02 ` Zwane Mwaikambo
2002-07-13 7:43 ` Muli Ben-Yehuda
2002-07-13 14:49 ` Thunder from the hill
2002-07-13 8:17 ` Mike Galbraith
2002-07-13 13:10 ` Kenneth Johansson
2002-07-13 13:41 ` Roy Sigurd Karlsbakk
2002-07-13 14:59 ` Alan Cox
2002-07-16 20:36 ` James Antill
2002-07-13 14:24 ` Alan Cox
2002-07-13 13:34 ` William Lee Irwin III
2002-07-13 18:46 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2002-07-13 21:31 Dan Kegel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox