]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: Stray inform note with -Waddress [PR106947]
authorMarek Polacek <polacek@redhat.com>
Mon, 19 Sep 2022 18:12:55 +0000 (14:12 -0400)
committerMarek Polacek <polacek@redhat.com>
Mon, 19 Sep 2022 18:19:26 +0000 (14:19 -0400)
commit2d9429d5c0f86f588bdfd85bb9e236d2be367d3f
treea1b970dc9763cf99f53e19ae20e5288285d1eeec
parentde40fab2f32b03c3d8f69f72c7f1e38694f93d35
c: Stray inform note with -Waddress [PR106947]

A trivial fix for maybe_warn_for_null_address where we print an
inform note without first checking the return value of a warning
call.

PR c/106947

gcc/c/ChangeLog:

* c-typeck.cc (maybe_warn_for_null_address): Don't emit stray
notes.

gcc/testsuite/ChangeLog:

* c-c++-common/Waddress-7.c: New test.
gcc/c/c-typeck.cc
gcc/testsuite/c-c++-common/Waddress-7.c [new file with mode: 0644]