Commit 7ec39552 by Martin Sebor Committed by Martin Sebor

builtin-sprintf-warn-1.c: Cast int argument to %lc directive to wint_t to…

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
parent 2db613e5
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.
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment