]> git.ipfire.org Git - thirdparty/gcc.git/commit
Correct and improve -Wnonnull for calls to functions with VLA arguments (PR middle...
authorMartin Sebor <msebor@redhat.com>
Tue, 29 Sep 2020 23:10:54 +0000 (17:10 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 29 Sep 2020 23:13:55 +0000 (17:13 -0600)
commit873f8c1e6df94a9dcbfbe69f06538e3e45ba151d
tree9c7680bda586670d728244c647851453b47c059b
parent969baf03acd8124345617cea125b148568c7370a
Correct and improve -Wnonnull for calls to functions with VLA arguments (PR middle-end/97188).

Resolves:
PR middle-end/97188 - ICE passing a null VLA to a function expecting at least one element

gcc/ChangeLog:

PR middle-end/97188
* calls.c (maybe_warn_rdwr_sizes): Simplify warning messages.
Correct handling of VLA argumments.

gcc/testsuite/ChangeLog:

PR middle-end/97188
* gcc.dg/Wstringop-overflow-23.c: Adjust text of expected warnings.
* gcc.dg/Wnonnull-4.c: New test.
gcc/calls.c
gcc/testsuite/gcc.dg/Wnonnull-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wstringop-overflow-23.c