Avoiding compiler warnings

Roland McGrath roland@hack.frob.com
Fri Aug 17 19:48:00 GMT 2012


> Avoiding new warnings would be a lot more practical if we used -Werror 
> (with -Wno-error=uninitialized or other such options added on a per-file 
> basis for files where avoiding the warnings seems too problematic).

No objections to the broad idea, though it will have to be done very
carefully and incrementally.

> (Practice from other tools would be a --enable-werror/--disable-werror 
> configure option, defaulting to --enable-werror during development (I 
> suppose based on the value of RELEASE in version.h) and --disable-werror 
> for releases.)

I don't think changing the default based on such a notion is proper at all.
It's especially important to catch subtle regressions when building releases.

When --disable-werror is likely to be needed is when using a much older (or
extremely new) compiler.  But I am not at all convinced that there should
be any automagic logic for disabling it at all.  We should just make sure
that there are no (unsuppressed) warnings for builds with either the latest
GCC or the GCC version recommended by README (i.e. today 4.8ish-trunk and 4.6).


Thanks,
Roland



More information about the Libc-alpha mailing list