[DTrace-devel] [PATCH] Initialize variable to eliminate compile-time warning

Eugene Loh eugene.loh at oracle.com
Wed Apr 27 20:14:57 UTC 2022


In any case:
*)  It's hard for me to see how our source code is better off without 
the initialization than with it.
*)  The patch is also useful because it declares the variable to be the 
proper size.

On 4/27/22 2:30 PM, Nick Alcock wrote:
> On 25 Apr 2022, Kris Van Hees via DTrace-devel outgrape:
>
>> There is only a compilation error there when you use an older compiler,
> GCC 12 still emits a warning.
>
>> because it fails to recognize that the 4 cases in the switch are exactly
>> the only four cases that could ever happen in this code and thus rc is
>> guaranteed to always have a value.
> All the compiler knows is that it's a uint :/ even LTO doesn't help.
> Cross-function value range analysis is *hard*, especially over that distance.



More information about the DTrace-devel mailing list