[Toybox] [PATCH] Fix bug in names_to_pid.

Rob Landley rob at landley.net
Mon Mar 12 18:38:23 PDT 2018


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.

Rob



More information about the Toybox mailing list