coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] maint: avoid uniq.c warning from bleeding-edge gcc's -Wstric


From: Jim Meyering
Subject: Re: [PATCH] maint: avoid uniq.c warning from bleeding-edge gcc's -Wstrict-overflow
Date: Fri, 16 Oct 2015 08:08:42 -0700

On Thu, Oct 15, 2015 at 10:17 AM, Pádraig Brady <address@hidden> wrote:
> On 15/10/15 17:58, Jim Meyering wrote:
>> On Thu, Oct 15, 2015 at 9:23 AM, Pádraig Brady <address@hidden> wrote:
>>> On 15/10/15 17:14, Jim Meyering wrote:
>>>> I build gcc from git regularly, and my first test is to use it to
>>>> build coreutils.
>>>> Today's gcc exposed this nit:
>> ...
>>>> -  int nfiles = 0;
>>>> +  unsigned int nfiles = 0;
>>>
>>> How about size_t since it's used as an array index?
>>
>> That variable is used solely to count/index-into argv-related things.
>> Are there systems that can support more than 2^32 command-line arguments?
>> Happy to change (consistency?), if you'd like.
>
> Heh, fair point :)
> I was mainly thinking of consistency with changes like:
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v7.4-72-g0e93175

Those uses in tail.c propagate through interfaces, which have a higher bar.
Since this "nfiles" variable is used solely in main, I left it as
"unsigned int" and pushed.
I wouldn't mind if you were to switch it to size_t.



reply via email to

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