[YBA] kernel compile errors with GCC >= 4.6
Oron Peled
oron at actcom.co.il
Thu Apr 5 13:26:03 IDT 2012
On Thursday, 5 בApril 2012 11:33:51 Nadav Har'El wrote:
>
> When "you" == "Linus Torvalds", I agree.
>
> When "you" == "kernel user" or even "developer working on one
> particular part of the kernel", I don't agree:
Many FOSS projects (and the kernel in particular) are very distributed,
so there are potentially hundreds of "Linus Torvalds's" out there.
Practically any developer working on some obscure Linux driver within
some company is producing code which *may* eventually reach the kernel
proper. Using global -Wall -Werror put most of the burden where it
should be -- on the shoulder of the one writing the code, instead
of starting to resolve these issues upon merging it upstream.
> > For other projects I think that the Makefile or build system that is
> > distributed with the project should only use -Werror after checking
> > that the GCC version is the same as the version used by the
> > developers for the release.
On the contrary, different compiler/environment/architecture are exactly
the edge-cases thay may lead to new bugs. It's better to try and handle
them during build-time rather than run-time.
In another mail on this thread, you mentioned a rare case of a compiler
wrongly warning about uninitialized variable:
* Maybe this was a compiler bug -- should it be ignored? (as would
definitely happen without -Werror), or maybe the compiler should
be fixed?
* More importantly, I've seen countless such warnings (in numerous
user-space programs). All of these were real bugs waiting to happen.
Weighting this against your (possible) single false-alarm convince
me again it's a bargain deal to '-Wall -Werror'
I think a more valid criticism is: why -Wunused-but-set-variable is
included in '-Wall' (which unlike its name implies does not include
all warnings). Maybe this specific warning (and other "style" ones)
should only be included in '-Wextra'.
> Then why distribute then -Werror at all? Let the developers use -Wall
> -Werror as part of their tests, and let users compile normally, without
> -Werror... Just my view...
I beg to disagree -- users do not compile code, they 'yum/aptitude install'
packages. Within FOSS community, each such "consumer" of your source
code actually help the project as another test-case (maybe on a different
platform, maybe different compiler, etc.) -- Yes, some of these test-cases
are just noise, but you don't know this before evaluating the specific
warning.
Happy Pesach,
--
Oron Peled Voice: +972-4-8228492
oron at actcom.co.il http://users.actcom.co.il/~oron
"The speed of light really is too slow nowdays." -- Alan Cox
More information about the Linux-il
mailing list