PR middle-end/85359 - duplicate -Wstringop-overflow for a strcmp call with a nonstrin...
authorMartin Sebor <msebor@redhat.com>
Tue, 22 May 2018 19:37:48 +0000 (19:37 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Tue, 22 May 2018 19:37:48 +0000 (13:37 -0600)
commit36537a1c41adabc6da23ae19e7c3a933582b19dd
treea8f5351bc207a35be81c86a6e2470a214629639e
parentaab778d3825052d262e3fc6d87af67e7cc196273
PR middle-end/85359 - duplicate -Wstringop-overflow for a strcmp call with a nonstring pointer

gcc/ChangeLog:

PR middle-end/85359
* builtins.c (expand_builtin_strcpy): Call maybe_warn_nonstring_arg
only when expasion succeeds.
(expand_builtin_strcmp): Same.
(expand_builtin_strncmp): Same.

gcc/testsuite/ChangeLog:

PR middle-end/85359
* gcc.dg/attr-nonstring.c: New test.

From-SVN: r260550
gcc/ChangeLog
gcc/builtins.c
gcc/calls.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/attr-nonstring.c [new file with mode: 0644]