https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95589
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=84316 Blocks| |86172 Keywords| |diagnostic --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- I was about to classify this as an enhancement but after reading the description of -Wnull-dereference in the manual ("compiler detects paths that trigger erroneous or undefined behavior due to dereferencing a null pointer") I'm inclined to view it as a bug. The code is clearly in error, GCC just doesn't detect it (even though the "doesn't detect it" part could be used to argue the warning works strictly as documented). Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86172 [Bug 86172] [meta-bug] issues with -Wnull-dereference