On 09/27/2016 10:43 PM, Jeff Law wrote:
On 09/27/2016 04:50 PM, Martin Sebor wrote:
The attached patch corrects a couple of typos in argument numbers
in the handling of __builtin__vsnprintf_chk calls in the gimple-
ssa-sprintf pass, and another couple of typos in the test for
this that were masking this failure.
As an aside, the patch also fixes the off-by-one line test failures
introduced in r240503. If there is a way to make the line numbers
relative (as suggested in
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg02070.html) I'm happy
to update the -Wformat-length tests to make use of them (and document
it on the Wiki) if someone can point me at an example (or
documentation). I couldn't find examples of dg-warning directives
that use the feature.
Thanks
Martin
gcc-77762.diff
PR c/77762 - Incorrect destination buffer length in -Wformat-length
warning
gcc/testsuite/ChangeLog:
2016-09-27 Martin Sebor <mse...@redhat.com>
PR c/77762
* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c (test_vsnprintf_chk_s):
Call __builtin___vsnprintf_chk, not __builtin___snprintf_chk.
(test_sprintf_p_const): Adjust line numbers to avoid failures
introduced in r240503.
gcc/ChangeLog:
2016-09-27 Martin Sebor <mse...@redhat.com>
PR c/77762
* gimple-ssa-sprintf.c (pass_sprintf_length::handle_gimple_call):
Fix typos.
OK.
The relative line number capability was just added:
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg01617.html
Thanks. I added it to the Wiki:
https://gcc.gnu.org/wiki/HowToPrepareATestcas
Martin