From patchwork Mon Mar 27 08:35:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 66925 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D891E3857438 for ; Mon, 27 Mar 2023 08:36:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D891E3857438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679906201; bh=nX1loegUwSWJ3GVd739DfcWHzGN7mbbeqfA3c+2neMc=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=JEz99GWRHymDFIB3GZ3leTfk66j4eg0PGy0CxPAzefIFlqE0ZFbWehJy/g8ljSSJ/ 0t7+nr7mgx8DV69Q+khMoN5WNHRCh1Jqt+mj0yWkR1rjnxhRDcio92H23HmUVHQ3Y3 zi59qScSuzl/x/RtbCBtvo1ICz0X9m0j+f/XUbT8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AB20F3858C83 for ; Mon, 27 Mar 2023 08:35:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AB20F3858C83 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-509-OD3ycQwbPpav12roLw5HDw-1; Mon, 27 Mar 2023 04:35:49 -0400 X-MC-Unique: OD3ycQwbPpav12roLw5HDw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79C4185C6E3; Mon, 27 Mar 2023 08:35:49 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C6AE1121330; Mon, 27 Mar 2023 08:35:49 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 32R8ZkKK3373635 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 10:35:47 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 32R8Zka33373634; Mon, 27 Mar 2023 10:35:46 +0200 Date: Mon, 27 Mar 2023 10:35:45 +0200 To: libstdc++@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++: Fix up experimental/net/timer/waitable/dest.cc testcase Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! 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. Ok for trunk? 2023-03-27 Jakub Jelinek * testsuite/experimental/net/timer/waitable/dest.cc: Avoid -Wformat warning if size_t is not unsigned long. Jakub --- libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc.jj 2023-01-16 11:52:17.394714745 +0100 +++ libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc 2023-03-25 14:35:49.046639413 +0100 @@ -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 ); }