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

Nick Alcock nick.alcock at oracle.com
Wed Apr 27 18:30:21 UTC 2022


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