Skip to content
Snippets Groups Projects
Commit 3c0f5a95 authored by Jakub Jelinek's avatar Jakub Jelinek
Browse files

libstdc++: Fix up experimental/net/timer/waitable/dest.cc testcase

In Fedora package build I've noticed a failure
/builddir/build/BUILD/gcc-13.0.1-20230324/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc: In function 'void test01()':
/builddir/build/BUILD/gcc-13.0.1-20230324/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc:41: warning: format '%lu' expects argument of type 'long unsigned int', but a
rgument 2 has type 'unsigned int' [-Wformat=]
FAIL: experimental/net/timer/waitable/dest.cc (test for excess errors)
Excess errors:
/builddir/build/BUILD/gcc-13.0.1-20230324/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc:41: warning: format '%lu' expects argument of type 'long unsigned int', but
+argument 2 has type 'unsigned int' [-Wformat=]
because we build with -Wformat.

The test uses %lu for size_t argument, which can be anything from unsigned
int to unsigned long long.  As for printf I'm not sure we can use %zu
portably and given the n == 1 assertion, I think the options are to kill
the printf, or cast to long.

2023-03-27  Jakub Jelinek  <jakub@redhat.com>

	* testsuite/experimental/net/timer/waitable/dest.cc: Avoid -Wformat
	warning if size_t is not unsigned long.
parent ff1f2f24
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment