This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Avoiding compiler warnings
On Fri, 17 Aug 2012, Marek Polacek wrote:
> With trunk gcc I'm seeing a few -Wstrict-aliasing warnings, two
> -Wstrict-aliasing and two -Wformat warnings (x86_64). So we'd need to
> fix these...
You could start with -Werror -Wno-error=strict-aliasing as the default.
(-Wformat warnings really should be fixed in all cases; some other
warnings may be more liable to false positives that are harder to fix.)
> However, with --enable-all-warnings, there are tons of various
> warnings coming from e.g. -Wcast-qual, -Wsign-compare, etc. So it'd be
> impossible to use those two together.
I'm a bit doubtful of the use of --enable-all-warnings. I'd probably say
that each of the extra warning options in there could be added to the
default warnings individually - if the fixes required for the warnings
shown up by that option seem reasonable. Some of the extra warnings are
in -Wall anyway.
--
Joseph S. Myers
joseph@codesourcery.com