]> gcc.gnu.org Git - 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:42:58 +0000 (14:42 -0400)
commit97803ee561c7a2692a6d7863a5d86797d79a18b1
tree289c28e98395279d0ce68c4af0decb350419940e
parent57896e8cddd2eb952145fa32ca25635fd63246b4
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.

(cherry picked from commit 2d9429d5c0f86f588bdfd85bb9e236d2be367d3f)
gcc/c/c-typeck.cc
gcc/testsuite/c-c++-common/Waddress-7.c [new file with mode: 0644]
This page took 0.053898 seconds and 5 git commands to generate.