This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Latest snapshot won't build with --enable-libstdcxx-v3
espie@quatramaran.ens.fr (Marc Espie) writes:
> >Putting in -Werror forces the developers to produce warning-free code.
>
> I'd concur.
> Not only that, but some people routinely compile some critical code with
> a large list of warnings, plus -Werror... (the OpenBSD kernel, for instance).
>
> so yes, having warnings in header code is a complete no-no.
as an aside about this:
there are a lot of people out there who e.g. use -Wall and -Werror
(e.g. at least NetBSD as well).
For them, the addition of warnings which are in fact spurious,
i.e. correct code that's not bad style, is Really Bad.
For instance, the fact that -Wuninitialized often returns (or has
historically returned) false positives has caused NetBSD to _remove
it_ from NetBSD gcc's "-Wall". Personally, I find that unfortunate,
because i'd like -Wall to be -Wall everywhere, and I'd like it to
include -Wuninitialized... but i'd like -Wuninitialized to only warn
if it knows there's a problem. (maybe somebody should do a
-Wuninitialized=2 like -Wformat...)
If there's some bad style that you really want to force people to fix
(e.g. bad parenthesization) that's one thing, but spurious warnings
cause by compiler confusion are Really Bad and make many people's
lives harder.
(This post, plus something I saw earlier about adding warnings if the
compiler can't invoke certain optimizations because of complexity,
made me feel inclined to pipe up about this.)
cgd