From: Martin Sebor Date: Sat, 23 Feb 2019 20:46:04 +0000 (+0000) Subject: builtin-sprintf-10.c: Cast remaining wchar_t to wint_t to avoid a bogus -Wformat... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46d496b9d93f7a647c9f5d58fed94f9e7fa299ab;p=gcc.git builtin-sprintf-10.c: Cast remaining wchar_t to wint_t to avoid a bogus -Wformat warning in ILP32... gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/builtin-sprintf-10.c: Cast remaining wchar_t to wint_t to avoid a bogus -Wformat warning in ILP32 (bug 77970). From-SVN: r269167 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cfb8841bf65..dd9877efe5b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-02-23 Martin Sebor + + * gcc.dg/tree-ssa/builtin-sprintf-10.c: Cast remaining + wchar_t to wint_t to avoid a bogus -Wformat warning in + ILP32 (bug 77970). + 2019-02-23 H.J. Lu PR testsuite/89476 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c index b64a5e0116e..489af62a5ad 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-10.c @@ -48,16 +48,16 @@ const wchar_t ws3[] = L"12\xff"; void elim_wide_char_call (void) { - ELIM (snprintf (0, 0, "%lc", L'\0')); - ELIM (snprintf (0, 0, "%lc", L'1')); - ELIM (snprintf (0, 0, "%lc", L'a')); + ELIM (snprintf (0, 0, "%lc", (wint_t)L'\0')); + ELIM (snprintf (0, 0, "%lc", (wint_t)L'1')); + ELIM (snprintf (0, 0, "%lc", (wint_t)L'a')); ELIM (snprintf (0, 0, "%lc", (wint_t)ws3[0])); ELIM (snprintf (0, 0, "%lc", (wint_t)ws3[1])); ELIM (snprintf (0, 0, "%lc", (wint_t)ws3[3])); - ELIM (snprintf (0, 0, "%C", L'\0')); - ELIM (snprintf (0, 0, "%C", L'9')); - ELIM (snprintf (0, 0, "%C", L'z')); + ELIM (snprintf (0, 0, "%C", (wint_t)L'\0')); + ELIM (snprintf (0, 0, "%C", (wint_t)L'9')); + ELIM (snprintf (0, 0, "%C", (wint_t)L'z')); ELIM (snprintf (0, 0, "%C", (wint_t)ws3[0])); ELIM (snprintf (0, 0, "%C", (wint_t)ws3[1])); ELIM (snprintf (0, 0, "%C", (wint_t)ws3[3])); @@ -82,13 +82,13 @@ void elim_wide_string_call (void) void keep_wide_char_call (void) { - KEEP (snprintf (0, 0, "%lc", L'\xff')); - KEEP (snprintf (0, 0, "%lc", L'\xffff')); + KEEP (snprintf (0, 0, "%lc", (wint_t)L'\xff')); + KEEP (snprintf (0, 0, "%lc", (wint_t)L'\xffff')); KEEP (snprintf (0, 0, "%lc", (wint_t)wc)); KEEP (snprintf (0, 0, "%lc", (wint_t)ws3[2])); - KEEP (snprintf (0, 0, "%C", L'\xff')); - KEEP (snprintf (0, 0, "%C", L'\xffff')); + KEEP (snprintf (0, 0, "%C", (wint_t)L'\xff')); + KEEP (snprintf (0, 0, "%C", (wint_t)L'\xffff')); KEEP (snprintf (0, 0, "%C", (wint_t)wc)); KEEP (snprintf (0, 0, "%C", (wint_t)ws3[2]));