From 8a123229ae34a3e81811e54341d629712f16ac1a Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Fri, 6 Jan 2017 15:45:42 +0000 Subject: [PATCH] PR middle-end/78605 - bogus -Wformat-length=1 with %f gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr78605.c: New test. From-SVN: r244164 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/pr78605.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr78605.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 275040cbf59..7ffa070af01 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-06 Martin Sebor + + PR middle-end/78605 + * gcc.dg/tree-ssa/pr78605.c: New test. + 2017-01-05 Martin Sebor PR tree-optimization/78910 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr78605.c b/gcc/testsuite/gcc.dg/tree-ssa/pr78605.c new file mode 100644 index 00000000000..1fad3146d5b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr78605.c @@ -0,0 +1,15 @@ +/* PR middle-end/78605 - bogus -Wformat-length=1 with %f + { dg-do compile } + { dg-options "-O2 -Wall -Wextra -Wformat-length=1" } */ + +char d[10]; + +int f (int i) +{ + return __builtin_sprintf (d, "%i %i", i, i); +} + +int g (float f) +{ + return __builtin_sprintf (d, "%.2f %.2f", f, f); +} -- 2.30.2