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

--- Comment #54 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to janus from comment #53)

Unfortunately, it isn't.  The warning depends on actually dereferencing the
null pointer (i.e., trying to access the object it points to) and passing the
argument in the call to f(*((int*) NULL)) doesn't do that.  The pointer is
derefernced later, in f, but the -Wnull-dereference checker doesn't see it
because the call to f() isn't inlined by the time it runs (or ever).  To issue
the warning in this case the check also needs to happen when binding to
references.

Reply via email to