bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] warnings: check -Wfoo rather than -Wno-foo


From: Eric Blake
Subject: Re: [PATCH] warnings: check -Wfoo rather than -Wno-foo
Date: Wed, 14 Aug 2013 22:07:19 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

On 08/14/2013 05:49 PM, Paul Eggert wrote:
> Eric Blake wrote:
> 
>> -  gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors 
>> $1"])
>> +  gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
>> +    [" $gl_unknown_warnings_are_errors ]m4_bpatsubst([$1], [^-Wno-], 
>> [-W])["])
> 
> This assumes that gl_COMPILER_OPTION_IF's argument is
> a constant, so won't it have trouble with the following
> common idiom (this example taken from coreutils/configure.ac)?
>  
>   gl_MANYWARN_ALL_GCC([ws])
>   gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
>   for w in $ws; do
>     gl_WARN_ADD([$w])
>   done
> 
> gl_WARN_ADD calls gl_COMPILER_OPTION_IF.

In this case, it just means that $w is not munged at m4 time; leaving us
no worse than pre-patch, but not fixing the issue at hand.  I guess that
means I want a polymorphic variant - if it is a constant, munge it at m4
time; otherwise, pass it through a sed script at shell time.  I'll work
on a followup patch so that even if $w contains a -Wno-foo element from
$ws, it will properly be testing against -Wfoo.

-- 
Eric Blake   eblake redhat com    +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]