[Bug middle-end/79496] call to snprintf eliminated with -Wformat-truncation=2
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 14 04:39:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79496
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Tue Feb 14 04:38:54 2017
New Revision: 245415
URL: https://gcc.gnu.org/viewcvs?rev=245415&root=gcc&view=rev
Log:
PR middle-end/79496 - call to snprintf with zero size eliminated with
-Wformat-truncation=2
gcc/ChangeLog:
PR middle-end/79496
* gimple-ssa-sprintf.c (pass_sprintf_length::handle_gimple_call): Avoid
clearing info.nowrite flag when snprintf size argument is a range.
gcc/testsuite/ChangeLog:
PR middle-end/79496
* gcc.dg/tree-ssa/builtin-snprintf-2.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-ssa-sprintf.c
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list