public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r13-6876] libstdc++: Fix up experimental/net/timer/waitable/dest.cc testcase
Date: Mon, 27 Mar 2023 10:02:39 +0000 (GMT)	[thread overview]
Message-ID: <20230327100239.14D143858D39@sourceware.org> (raw)

https://gcc.gnu.org/g:3c0f5a9533bcb200d2d49755e653cf8f6c637118

commit r13-6876-g3c0f5a9533bcb200d2d49755e653cf8f6c637118
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Mar 27 12:02:06 2023 +0200

    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.

Diff:
---
 libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc b/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc
index cff654c0527..cb818708aef 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 );
 }

                 reply	other threads:[~2023-03-27 10:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230327100239.14D143858D39@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).