[Bug sanitizer/79572] [6/7 Regression] reference binding to null pointer not reported with -fsanitize=undefined
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 17 15:11:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79572
--- Comment #10 from janus at gcc dot gnu.org ---
(In reply to janus from comment #9)
> But at least clang 3.9 has some additional diagnostics:
>
> null_ref.cpp:11:5: warning: binding dereferenced null pointer to reference
> has undefined behavior [-Wnull-dereference]
> f(*((int*) NULL));
> ^~~~~~~~~~~~~~
>
> Ideally GCC should yield the same warning
See PR 16351. Lately GCC seems to have a -Wnull-dereference flag as well, but
apparently it fails on the test case here.
More information about the Gcc-bugs
mailing list