[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: factor st_ctime-comparison out of two headers
From: |
Ben Pfaff |
Subject: |
Re: [PATCH] tests: factor st_ctime-comparison out of two headers |
Date: |
Sun, 20 Nov 2011 10:53:17 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Simon Josefsson <address@hidden> writes:
> Ben Pfaff <address@hidden> writes:
>
>> Simon Josefsson <address@hidden> writes:
>>
>>> Bruno Haible <address@hidden> writes:
>>>
>>>> Jim Meyering wrote:
>>>>> -W
>>> ...
>>>>> -Wwrite-strings
>>>>> -fdiagnostics-show-option
>>>>
>>>> Thanks. I've updated my build script to include these for glibc/x86 builds
>>>> (except -Werror, which causes a configuration error already in
>>>> "checking whether the compiler works...").
>>>
>>> I recommend putting warning flags in a separate variable,
>>> e.g. WARN_CFLAGS, which is not used during ./configure checks but only
>>> when building (parts of) the project code. That way, -Werror can be
>>> used, which I find helpful since I can mentally ignore the compilation
>>> output since I know I will be interrupted if there is anything real to
>>> pay attention to.
>>
>> 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. [...]
The argument to AC_CONFIG_COMMANDS_PRE is run just before
creating config.status, regardless of when the
AC_CONFIG_COMMANDS_PRE command itself runs, so it doesn't risk
affecting any configure checks.
Here's the documentation for AC_CONFIG_COMMANDS_PRE from the
Autoconf manual.
-- Macro: AC_CONFIG_COMMANDS_PRE (CMDS)
Execute the CMDS right before creating `config.status'.
This macro presents the last opportunity to call `AC_SUBST',
`AC_DEFINE', or `AC_CONFIG_ITEMS' macros.
--
Ben Pfaff
http://benpfaff.org
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, (continued)
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Bruno Haible, 2011/11/18
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Jim Meyering, 2011/11/18
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Bruno Haible, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Jim Meyering, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Bruno Haible, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Simon Josefsson, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Ben Pfaff, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Simon Josefsson, 2011/11/20
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Peter Johansson, 2011/11/20
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Jim Meyering, 2011/11/20
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers,
Ben Pfaff <=
- Re: warning options, Bruno Haible, 2011/11/20
- Re: warning options, Paul Eggert, 2011/11/20
- Re: warning options, Bruno Haible, 2011/11/20
- Re: warning options, Paul Eggert, 2011/11/21
- Re: warning options, Bruno Haible, 2011/11/27
- Re: warning options, Paul Eggert, 2011/11/28