gimple-ssa-sprintf.c (struct fmtresult): Add new member and initialize it.
authorMartin Sebor <msebor@redhat.com>
Wed, 3 Oct 2018 20:00:46 +0000 (20:00 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 3 Oct 2018 20:00:46 +0000 (14:00 -0600)
commita41cc59de4134194fc2e96beb12cf18737da3cee
tree0988b94c4dbe58784462cbb8759f7fce187de973
parent119b4963ea4f68e88eb496f0efcb450e1fbbbe9b
gimple-ssa-sprintf.c (struct fmtresult): Add new member and initialize it.

* gimple-ssa-sprintf.c (struct fmtresult): Add new member and
initialize it.
(get_string_length): Detect unterminated arrays.
(format_string): Same.
(format_directive): Warn about unterminated arrays.
(handle_gimple_call): Mark statements with no_warning as needed.

* gcc.dg/warn-sprintf-no-nul.c: New test.

Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r264822
gcc/ChangeLog
gcc/gimple-ssa-sprintf.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/warn-sprintf-no-nul.c [new file with mode: 0644]