coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] maint: enable -Wmissing-field-initializers


From: Pádraig Brady
Subject: Re: [PATCH] maint: enable -Wmissing-field-initializers
Date: Sun, 08 May 2011 17:34:22 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 27/04/11 21:31, Pádraig Brady wrote:
> On 27/04/11 21:14, Jim Meyering wrote:
>> Pádraig Brady wrote:
>>> I'll apply the attached after the pending release.
>>>
>>> Subject: [PATCH] maint: enable -Wmissing-field-initializers
>>>
>>> * configure.ac: Enable -Wmissing-field-initializers for src/
>>> but leave disabled for lib/.
>>> * src/system.h: Enable the static variable hack only for
>>> non gcc compilers and versions of gcc older than 4.7.
>>> Starting with that version, the warning is no longer issued for
>>> variables initialized with a single zero value.
>>> Rename DECLARE_ZEROED_AGGREGATE to the more concise
>>> and accurate DECLARE_ZEROED_AUTO.
>>> * src/ls.c: Use the renamed macro.
>>> * src/pathchk.c: Likewise.
>>> * src/shred.c: Likewise.
>>> * src/stty.c: Likewise.
>>> * src/wc.c: Likewise.
>>
>> Nice.  You beat me to it.
>> Thanks.
> 
> I was thinking actually of changing this, and doing this solely within
> manywarnings.m4 in gnulib. I.E. apply -Wno-missing-field-initializers
> conditionally there (depending on result of compiling {0,}).
> 
> Then we could remove all this stuff from coreutils,
> including the DECLARE_ZEROED_AGGREGATE macro.
> 
> 

Now that this gnulib change is included
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=2953da14
I'll apply the attached.
This will both enable the warning on GCC >= 4.7 and
remove the warkarounds from the code.

cheers,
Pádraig.

Attachment: missing-field-init-warning.diff
Description: Text Data


reply via email to

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