diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-03-27 12:02:06 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-03-27 12:02:06 +0200 |
commit | 3c0f5a9533bcb200d2d49755e653cf8f6c637118 (patch) | |
tree | 3c73b8422e1f7fbcd0e267d9b2c835969051e3a0 | |
parent | ff1f2f2412bda118f7ddc10e69bd4284d9b24b9e (diff) | |
download | gcc-3c0f5a9533bcb200d2d49755e653cf8f6c637118.zip gcc-3c0f5a9533bcb200d2d49755e653cf8f6c637118.tar.gz gcc-3c0f5a9533bcb200d2d49755e653cf8f6c637118.tar.bz2 |
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.
-rw-r--r-- | libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc b/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc index cff654c..cb81870 100644 --- a/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc +++ b/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc @@ -38,7 +38,7 @@ test01() timer.async_wait([&ec](std::error_code e) { ec = e; }); } auto n = ctx.run(); - __builtin_printf("ran %lu\n", n); + __builtin_printf("ran %lu\n", long(n)); VERIFY( n == 1 ); VERIFY( ec == std::errc::operation_canceled ); } |