[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Suppressing GCC's "uninitialised" warnings [was: svn commit: r18040 ...]

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-01-19 04:02:04 CET

Daniel Rall wrote:
> I didn't realize that CFLAGS already contained -Wall. It's not
> explicitly added by our configure process, but I see it in Makefile.
> Perhaps it's inherited from httpd or APR.
> Using CFLAGS instead of an override which always turns off that type
> of warning is easy enough (see below), but it seemed less appropriate
> given the situation (since people can still easily shoot themself in
> the foot). What do you think?

This warning only seems to occur in this situation (the r18040 situation:
passing "&var" to a local function which either initialises "var" or returns an
error) if the option "-funit-at-a-time" is given, as Philip mentioned.
Furthermore it is only a problem when "-Werror" is also given. But note well
that the same warning can be produced in other situations, such as simple use
of the value of a variable before it is initialised.

I think maybe trying to suppress "uninitialised" warnings is trying to be too
clever. It's nice to provide a warning-free build when invoked with just the
default options, but if someone is adding extra flags it is up to them to
specify the flags they need to get the effect they want.

Suppressing all "uninitialised" warnings, even when "-funit-at-a-time" and
"-Werror" are not given, may hurt more people than it helps. Therefore I think
we should not do this.

- Julian

> [[[
> Disable GCC 4.0.1's inconsistent "uninitialized" warnings, which
> otherwise cause build failures when using its '-Wall -Werror' flags.
> A follow-up to the r18040/r18161 commit/revert.
> * configure.in
> (CFLAGS): Add new -Wno-uninitialized compilation flag onto the end
> of this argument list when the compiler (CC) is gcc.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jan 19 04:39:45 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.