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: 75264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1356863vqo; Mon, 27 Mar 2023 01:37:01 -0700 (PDT) X-Google-Smtp-Source: AKy350aOgwClp6Tg0p4VEZ9/AKTkP+dKq9Ek6pMINpDOf9l2RapFld8qTA5+UvkX2i63Lk1bQjL2 X-Received: by 2002:a17:907:76f8:b0:939:c395:1b3 with SMTP id kg24-20020a17090776f800b00939c39501b3mr11461801ejc.31.1679906221058; Mon, 27 Mar 2023 01:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679906221; cv=none; d=google.com; s=arc-20160816; b=zGsoaa3EsyPf5W1yyEudn6krRpWwdA1pNQKPXHQ0FxloBDVOP7BshSQ6laIB11O0Pl dp1gI2+Ey5IHQ8XWWaXJMG/GbHiqRmQWF8+aQnhFjbQrFkCNUlJ9JUWH3Wj3w4q/vD9o oWyDw7ZXEHRmH7DAySQaGlD/SAeageVfcsbf5klmss3GEF99QOC/iR/VxHL7JSUZ74sj EzCCiuYDa1QG8sCvimcW0XzIWItLkrAQqoABH/Y7A9Qd472ces2cApL/OJUEPJCB9HRU 55UwA5kSEIIJcIGhyxQ+OQSycTi/RhodHkl1CLZiz1kyW5KEvX2pQ/MSGRSX43wMke0G XyjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=nX1loegUwSWJ3GVd739DfcWHzGN7mbbeqfA3c+2neMc=; b=C6Zmb7SnXXm0pAzMje0Yt8vzZggaCGiroxo02Px6fTkDZ/lCJoqpGZ4T5yE9AWTLg5 928Zlbb2Agx+lkKqvx4rBpC6/8f2RQH+Edmq4btzDeCP/KvOSSM4LJKlaehrGCswqGS0 Jy7YaTnYG3CJjSS+D9yDAiPKito8V7JQ5sh/scPbro/XEXDS8xuKQiRNKqjocvu2K2VD +sZ6vtDGJaNs5Cb52I0vO95cIk2jjMPCsq4a6KMTqzpEaJSFGNDdUP+eiSsXpvAHIJN6 kw98A9LIycWXP8eL5kxYJIdRTUTql8FxNfB7cdXW6rGmyN/6UyjiEdnvDWajd9CzLDON lKcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=d47QuZpS; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gt19-20020a1709072d9300b0093959594e50si20929562ejc.248.2023.03.27.01.37.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 01:37:01 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=d47QuZpS; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 663083858C00 for ; Mon, 27 Mar 2023 08:36:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 663083858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679906218; 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=d47QuZpSdWWibN/x+XxaRQXPfHd4KLW22oGeadh4HghSPp6L7eoSfDf+wUVCdYVvZ lmBtpd5/qY3BzRAHIaVRYf18l9JI86zw+sXdugYxM90NaUkjJ/iHZh5q56OqRzsU4x LfWg0tk3m4OSZdQRCmD5LAYLZSHPGMTNMgB5NSZM= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761509345159026151?= X-GMAIL-MSGID: =?utf-8?q?1761509345159026151?= 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 ); }