[Toybox] [PATCH] Fix bug in names_to_pid.

Rob Landley rob at landley.net
Wed Mar 14 18:10:57 PDT 2018


On 03/14/2018 06:45 PM, enh wrote:
> On Mon, Mar 12, 2018 at 6:38 PM, Rob Landley <rob at landley.net> wrote:
>> On 03/12/2018 11:13 AM, enh wrote:
>>> Found by the compiler, not me:
>>>
>>>   lib/lib.c:1053:30: warning: 'st2.st_dev' may be used uninitialized
>>> in this function [-Wmaybe-uninitialized]
>>>          if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) continue;
>>>                            ~~~^~~~~~~
>>
>> I despise the "may be used uninitialized" warning. It either is or it isn't.
>>
>> In this case, yes it looks like it is. So it should say "is used uninitialized".
>> (They were 2 separate warnings in gcc for years and it was a fountain of false
>> positives to the point I learned the "int a=a;" initializers from the kernel to
>> SHUT IT UP.
>>
>> Anyway, appled.
> 
> since this went unnoticed i really want to remove -Wno-uninitialized
> from our build. it turns out that there's currently only one other
> line that clang's unhappy with, and it's our old friend
> CFG_TOYBOX_DEBUG...
> 
> [PATCH] Fix last uninitialized warning.

Grumble grumble grumble... Applied, but under protest.

Rob



More information about the Toybox mailing list