https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104082
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 CC| |msebor at gcc dot gnu.org Last reconfirmed| |2022-01-18 Status|UNCONFIRMED |NEW --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- It's a style warning as much as a correctness one (like most warnings are). A good programmers style workaround would be int *metricp; void s88() { int distance; metricp = &distance; metricp = NULL; } but I realize that's tedious and wasted cycles in the end (when all bogus users are identified and fixed). I do question -Wdangling-pointer being included in -Wall, it's at most -Wextra category, if at all.