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

Re: svn commit: r18040 - in trunk/subversion: libsvn_delta libsvn_fs_fs libsvn_ra_dav libsvn_ra_svn libsvn_repos libsvn_subr libsvn_wc svn tests/libsvn_delta

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-01-19 00:41:26 CET

On Wed, 18 Jan 2006, Philip Martin wrote:

> Daniel Rall <dlr@collab.net> writes:
>
> > On Wed, 18 Jan 2006, Philip Martin wrote:
> >
> >> Daniel Rall <dlr@collab.net> writes:
> >>
> >> > * configure.in
> >> > (OVERRIDE_CFLAGS): Add new substitution used when the compiler (CC)
> >> > is gcc, tacking "-Wno-uninitialized" onto the end of the
> >> > compilation flags. This additional substitution is necessary
> >> > because GCC 4.0.1 takes argument ordering of such flags into
> >> > consideration, and the flags may need to be positioned after
> >> > EXTRA_CFLAGS to take affect.
> >>
> >> Why should -Wno-uninitialized override EXTRA_CFLAGS? I thought that
> >> EXTRA_CFLAGS was *intended* to override the other CFLAGS.
> >
> > Because the command-line positioning of gcc's compilation flags
> > impacts their interpretation, '-Wall -Werror -Wno-uninitialized'
> > works, while '-Wno-uninitialized -Wall -Werror' fails (I assume
> > because -Wall clobbers -Wno-uninitialized).
>
> I know that, but I don't see why that means -Wno-uninitialized in the
> Makefile has to override EXTRA_CFLAGS. EXTRA_CFLAGS is the way a user
> can override whatever is in the Makefile, you are making it impossible
> to override -Wno-uninitialized.

If EXTRA_CFLAGS includes -Wall, any -Wno-uninitialized flag added to
CFLAGS will be ignored by GCC, and result in compilation warnings.
This is especially annoying if EXTRA_CFLAGS includes -Werror, which
turns those warnings into build failures.

Given that Subversion's source code, when compiled using some version
of GCC, will always generate seemingly spurious warnings, it didn't
seem unreasonable to supress those warnings (regardless of
EXTRA_CFLAGS).

> If configure is going to put both -Wall and -Wno-uninitialized in the
> Makefile then it needs to ensure that they are in the right order, but
> they should both go before EXTRA_CFLAGS.

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?

[[[
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.

Suggested by: philip
              lundblad
]]]

Index: configure.in
===================================================================
--- configure.in (revision 18163)
+++ configure.in (working copy)
@@ -694,6 +694,16 @@
 
 # ==== Miscellaneous bits ====================================================
 
+if test "$CC" = "gcc" ; then
+ # Turn off compilation warning known to cause problems with
+ # Subversion's source and GCC 4.0.1.
+ if echo "$CFLAGS" | grep '\-Wall' > /dev/null; then
+ if echo "$CFLAGS" | grep -v '\-Wno-uninitialized' > /dev/null; then
+ CFLAGS="$CFLAGS -Wno-uninitialized"
+ fi
+ fi
+fi
+
 dnl Since this is used only on Unix-y systems, define the path separator as '/'
 AC_DEFINE_UNQUOTED(SVN_PATH_LOCAL_SEPARATOR, '/',
         [Defined to be the path separator used on your local filesystem])

  • application/pgp-signature attachment: stored
Received on Thu Jan 19 02:55:08 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.