On Wed, Jan 08, 2014 at 09:44:20AM +0100, Vincent Lefevre wrote: > On 2014-01-07 21:30:29 -0800, Ben Pfaff wrote: > > On Fri, Jan 03, 2014 at 10:22:27PM +0100, Vincent Lefevre wrote: > > > A developer may want to test his software with > > > -Werror=old-style-definition (in particular because such definitions > > > could be a real bug in the software). But configure fails because > > > autoconf generates such a function definition. For instance: > > > > In my opinion, it's a mistake to run "configure" tests with -Werror. > > I don't see why.
As compilers evolve, they will inevitably come to issue new warnings, some of which will be triggered by configure tests. Authors of Autoconf tests cannot possibly write them to avoid all warnings issued by future versions of GCC. > > I suggest adding such flags after configure tests have been run, as > > with the --enable-Werror configure flag supported by Open vSwitch: > > > > dnl OVS_ENABLE_WERROR > > AC_DEFUN([OVS_ENABLE_WERROR], > > [AC_ARG_ENABLE( > > [Werror], > > [AC_HELP_STRING([--enable-Werror], [Add -Werror to CFLAGS])], > > [], [enable_Werror=no]) > > AC_CONFIG_COMMANDS_PRE( > > [if test "X$enable_Werror" = Xyes; then > > CFLAGS="$CFLAGS -Werror" > > fi])]) > > This doesn't solve the problem at all: whether -Werror is used via > --enable-Werror or via > > ./configure ... CFLAGS="... -Werror" > > the same errors will occur. No, configuration time errors will not occur with this macro, because this macro adds -Werror only after all of the configuration tests have already run. > > I guess that -Werror=old-style-definition is somewhat more restricted, > > but a similar solution can be used. > > Actually I wasn't using -Werror=old-style-definition directly, but > > ./configure CFLAGS="-Wall -Wold-style-declaration -Wold-style-definition > -Wmissing-parameter-type -Wmissing-prototypes -Wmissing-declarations > -Wmissing-field-initializers -Werror" If you did the same thing but dropped -Werror from CFLAGS and added --enable-Werror, there would be no problem with configuration tests. > IMHO, this is a good thing developers test that their software doesn't > generate warnings, possibly with some exceptions; some errors can be > avoided with -Wno-error=..., e.g. one needs -Wno-error=unused-function > in the case of MPFR (and also gcc-snapshot). The -Werror allows one to > do that in automatic tests without filtering the output. > > Indeed if some new code generates a new warning, it may correspond to > a bug. > > In the particular case of -Werror=old-style-definition, this has > corresponded to an obsolescent feature of C for more than 14 years, > so that there are no reasons why programs would still use this old > style definition. > > My proposed patch concerning autoconf: > > http://lists.gnu.org/archive/html/autoconf-patches/2014-01/msg00003.html You reported this upstream? I'm not sure why you're reporting it to Debian also, then. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org