bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests: factor st_ctime-comparison out of two headers


From: Peter Johansson
Subject: Re: [PATCH] tests: factor st_ctime-comparison out of two headers
Date: Sun, 20 Nov 2011 13:58:04 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.23) Gecko/20110920 Thunderbird/3.1.15

On 11/20/11 1:49 PM, Simon Josefsson wrote:
>  Another approach is to add -Werror last (this is what Eric Blake
>  suggested on the autoconf mailing list a long time ago), e.g.:
>
>  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])])
But does that really work?  Don't you risk affecting ./configure checks
that often are written in a way that triggers warnings, and with the
-Werror flag, leads to compilation errors.  If the only reason for the
compilation to fail was the -Werror flag, then that ./configure check
has the wrong result.  I guess it may depend on where in the ./configure
run the statement above is placed, but that seems fragile to me.
Hi Simon,

The key is that -Werror is added to CFLAGS within AC_CONFIG_COMMANDS_PRE, which means it occurs in configure just before config.status is created, in other words, all checks should already have been executed.

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]