PR tree-optimization/87756 - missing unterminated argument warning using address...
authorMartin Sebor <msebor@redhat.com>
Fri, 23 Nov 2018 18:45:45 +0000 (18:45 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 23 Nov 2018 18:45:45 +0000 (11:45 -0700)
commit70c70369ce868fd8b049f710c01a899e502f6f68
treee911138371a57dd5587cf3a3cc4e7882f5327607
parentdb1d09b049a9388c481ff76aa00fe74734cce1c8
PR tree-optimization/87756 - missing unterminated argument warning using address of a constant character

gcc/ChangeLog:

PR tree-optimization/87756
* expr.c (string_constant): Synthesize a string literal from
the address of a constant character.
* tree.c (build_string_literal): Add an argument.
* tree.h (build_string_literal): Same.

gcc/testsuite/ChangeLog:

PR tree-optimization/87756
* gcc.dg/builtin-memchr-2.c: New test.
* gcc.dg/builtin-memchr-3.c: Same.
* gcc.dg/warn-sprintf-no-nul-2.c: Same.

From-SVN: r266418
gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtin-memchr-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtin-memchr-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/warn-sprintf-no-nul-2.c [new file with mode: 0644]
gcc/tree.c
gcc/tree.h