https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125223

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> Aside: I don't like the use of "NULL" in those diagnostics. That is a macro
> with the value 0 (or maybe 0L or 0LL or similar), not a pointer. 

That's for C++. In C the macro might expand to a pointer, if NULL is defined as
(void*)0, but you still can't dereference that because you can't dereference a
void pointer. So it's still a category error even for C. The code would not
even compile if you tried to dereference "NULL". What the analyzer is detecting
is dereferencing a null pointer.

https://cigix.me/c23#6.3.2.3.p3
https://eel.is/c++draft/basic.compound#3.sentence-8

Reply via email to