https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114571
Bug ID: 114571 Summary: -Wzero-as-null-pointer-constant does not complain about NULL Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ossman at cendio dot se Target Milestone: --- Created attachment 57857 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57857&action=edit Test case We are looking at bringing up the TigerVNC project to a more modern C++ style, and one thing was using nullptr instead of NULL. We were very glad when we found -Wzero-as-null-pointer-constant to help out with this. Unfortunately, it doesn't seem to do much for NULL in modern¹ gcc. It spots usage of "0", but not any "NULL". clang has no trouble finding both. I've attached a test case with some comments on the cases we've seen. ¹ gcc 5 spots some, but not all NULL