From 7ec39552a5bae47ac78e2fe2b2d4010bced80475 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Tue, 4 Oct 2016 23:00:42 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 6 ++++++ .../gcc.dg/tree-ssa/builtin-sprintf-warn-1.c | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6615024165b..673b6f7b98c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-10-04 Martin Sebor + + * 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 PR c++/77804 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 b9acf660862..d375a5e9c97 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 -- 2.30.2