]> git.ipfire.org Git - thirdparty/gcc.git/commit
c-family: Fix ICE with -Wsuggest-attribute [PR98487]
authorMarek Polacek <polacek@redhat.com>
Fri, 16 Dec 2022 17:28:43 +0000 (12:28 -0500)
committerMarek Polacek <polacek@redhat.com>
Mon, 19 Dec 2022 16:48:59 +0000 (11:48 -0500)
commit0e345504ec9349d9a3bf826c3e16b7e973739485
tree7666809c365e62cf3d977bdb733816a7b6aab3aa
parent8e08394fdf9e06ca8ae0022d55bd777672f7a8f4
c-family: Fix ICE with -Wsuggest-attribute [PR98487]

Here we crash because check_function_format was using TREE_PURPOSE
directly rather than using get_attribute_name.

PR c/98487

gcc/c-family/ChangeLog:

* c-format.cc (check_function_format): Use get_attribute_name.

gcc/testsuite/ChangeLog:

* c-c++-common/Wsuggest-attribute-1.c: New test.

(cherry picked from commit 68e51bd0a85794cd437d3e740357dfef84dc560d)
gcc/c-family/c-format.cc
gcc/testsuite/c-c++-common/Wsuggest-attribute-1.c [new file with mode: 0644]