aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2016-10-04 23:00:42 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2016-10-04 17:00:42 -0600
commit7ec39552a5bae47ac78e2fe2b2d4010bced80475 (patch)
tree98d5be3c772b0c2786716414dd4dc531cd66d990
parent2db613e5d3a2698fcd32460ad23b0c1b8ae31c7a (diff)
downloadgcc-7ec39552a5bae47ac78e2fe2b2d4010bced80475.zip
gcc-7ec39552a5bae47ac78e2fe2b2d4010bced80475.tar.gz
gcc-7ec39552a5bae47ac78e2fe2b2d4010bced80475.tar.bz2
builtin-sprintf-warn-1.c: Cast int argument to %lc directive to wint_t to silence -Wformat warnings on...
gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Cast int argument to %lc directive to wint_t to silence -Wformat warnings on targets where the latter is a distinct type such as long. From-SVN: r240758
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c16
2 files changed, 14 insertions, 8 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6615024..673b6f7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2016-10-04 Martin Sebor <msebor@redhat.com>
+ * gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Cast int argument to
+ %lc directive to wint_t to silence -Wformat warnings on targets
+ where the latter is a distinct type such as long.
+
+2016-10-04 Martin Sebor <msebor@redhat.com>
+
PR c++/77804
* g++.dg/warn/Wplacement-new-size-4.C: New test.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
index b9acf66..d375a5e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
@@ -209,11 +209,11 @@ void test_sprintf_chk_c_const (void)
T (3, "%c%c", '1', '2');
/* Wide characters. */
- T (0, "%lc", 0); /* { dg-warning "nul past the end" } */
- T (1, "%lc", 0);
- T (1, "%lc%lc", 0, 0);
- T (2, "%lc", 0);
- T (2, "%lc%lc", 0, 0);
+ T (0, "%lc", (wint_t)0); /* { dg-warning "nul past the end" } */
+ T (1, "%lc", (wint_t)0);
+ T (1, "%lc%lc", (wint_t)0, (wint_t)0);
+ T (2, "%lc", (wint_t)0);
+ T (2, "%lc%lc", (wint_t)0, (wint_t)0);
/* The following could result in as few as no bytes and in as many as
MB_CUR_MAX, but since the MB_CUR_MAX value is a runtime property
@@ -1244,9 +1244,9 @@ void test_snprintf_c_const (void)
T (3, "%c%c", '1', '2');
/* Wide characters. */
- T (0, "%lc", 0);
- T (1, "%lc", 0);
- T (2, "%lc", 0);
+ T (0, "%lc", (wint_t)0);
+ T (1, "%lc", (wint_t)0);
+ T (2, "%lc", (wint_t)0);
/* The following could result in as few as a single byte and in as many
as MB_CUR_MAX, but since the MB_CUR_MAX value is a runtime property