bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_C_CONST is sensitive about -W -Wall -Werror CFLAGS.


From: Eric Blake
Subject: Re: AC_C_CONST is sensitive about -W -Wall -Werror CFLAGS.
Date: Thu, 22 Mar 2012 06:02:35 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 03/21/2012 10:34 PM, Artur R. Czechowski wrote:
> Hello,
> Plase consider simple autoconf.ac script:
> 
> AC_INIT([bugreport], [0.1])
> AC_C_CONST
> 
> After processing it with autoconf there is a differnce between the calls:
> ./configure
> ./configure CFLAGS="-W -Wall -Werror"

Don't do that.  This issue repeatedly comes up on the list, and the
answer is always the same - configuring with CFLAGS=-Werror is wrong,
because there is no way to portably write tests that are guaranteed to
be warning-free across all versions of all compilers.

If you _must_ use -Werror when building your package, then configure
without it, and add -Werror in later.  See for example how coreutils
does it, via it's --enable-gcc-warnings configure switch.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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