Message ID | 20231206143444.2760326-1-gb.devel@gmail.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4145973vqy; Wed, 6 Dec 2023 06:35:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTHFKK4b6TPJHI3dJzgVT1kiSQZobJCtsUmY+NPbF0+sk4+xGIl/FM8RHaYKL8XX32FUi7 X-Received: by 2002:a05:620a:1677:b0:77e:fe3b:dfc4 with SMTP id d23-20020a05620a167700b0077efe3bdfc4mr879548qko.131.1701873318259; Wed, 06 Dec 2023 06:35:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701873318; cv=pass; d=google.com; s=arc-20160816; b=N5TfiyRjDFmAhsjr/hIylF+M3Izo8586jDlOrhlK+3PRHJA36DI5Hj/wjw+EghRb+w GQpFUw4XWw7cdiCa/AvPP7aL3pBCvSk0x15gQBIpXmqGrNKcPi0WGNOVkiXoNymX+4N6 Wws8imcUsay8UyaFg1SwXf7V4ZgC4jjpbQZNp6/4xJLu07nz1lRJVFM2xGZZKjuhTGK7 NPSjX1Ps5gUCaSYPnWrbGqIk68savwtAwfJJ0eHSVMKOtaUCSPhFJ8lgiXUOw98/LjnY Zh1SRaoBGERD5n07UzowGu6T/KtL5HIPINe/PwKl2d398EKY6rGqAUdoY2TPB7nRJLSL 7I9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=rBryz6FZsdnLWsHRkjZ3U4RVCZkoRYTCAAY+wIQJwm4=; fh=ZuhCKx8SjXRXOmXA+h3tadzh2RTUBpTUfPNEZ0Boa6Y=; b=YO6YzCsxG2FW8Q+V+uCoDvSq4Wcq9O4pr4zhRGbHNJpZghC/LLEeWmcbRWUmqjn61y Ey3vFunSjNFbxbSE8l6KcYqD45kaGsdEL/NaFYdwItpYV5D/zsdIKAragaKsGInUtgby 1HLujSh2p+QgwP2ELiY7C+0GhHqkHS1Fnq/UtfLXx8FCWn2H0AhHC3e2H76YSHq4c0xW LXviqQwdK7CS2OL6yIv0/YOHHThnTQDrbx/yiBFdQu/ywBFs1LCO8ozKnwx4y24LAhkj yQkkrI5jRfOl9YYjtOnUidcJEFpUdzDL2i15ZW1PC51pDwaGAbRfgZ60cEi1D1zV/jze 1+ag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PuIcgVPP; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id bs38-20020a05620a472600b0077429d89227si14729743qkb.375.2023.12.06.06.35.18 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 06:35:18 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PuIcgVPP; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C45E3861837 for <ouuuleilei@gmail.com>; Wed, 6 Dec 2023 14:35:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id AAB3B3858D38 for <gcc-patches@gcc.gnu.org>; Wed, 6 Dec 2023 14:34:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AAB3B3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AAB3B3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701873295; cv=none; b=trxVggzIoq+9vld9mZm5I/i+xfQo4cfKsApiT22fAr/vZ+p4gAD6rzuZhqVxbctBXyINyBEU7PjGlyOs797JxGOe+4sdvAbNSiSJdjHLif7Vr17qV+nCKG9pG6BgfYM5ivUW4WCm1ROtIer1J15MtlbeCRP44u0tAhG87nXcsaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701873295; c=relaxed/simple; bh=T2HZvDzqjnnba+q78PSXJhPTl73B8tSCd3yz72wYXQw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=WcI1RgvhBf9cs8wo8XYzi9zFvFk33rpoE6OxeEIWxKbq2xstqyyH4GERcwQH3DvKqMzKTcq8htcdc8k+wRJxID0kTrWZexOoQwc21W7Ff1I/hhOY+ylmrFuEAbQmPtWUzpLoEgbROC0t2xqCPuqeopdUz7j0cPJCjfBMPPb4POs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40c256ffdbcso1779635e9.2 for <gcc-patches@gcc.gnu.org>; Wed, 06 Dec 2023 06:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701873289; x=1702478089; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rBryz6FZsdnLWsHRkjZ3U4RVCZkoRYTCAAY+wIQJwm4=; b=PuIcgVPPKaaNvakHLuZwyHNmk9mklvNvX/vj9FUgIpA5r+XXDUm4Kv+ofMpfWBEMkK HhyB0GZhQJV+EfOP2zyUhwPMUUdv9S0/MJN6TmouyYIrHScLmwNZ6zSZUvaSP6+Nl4ZQ T0fMtP6HF5d4Yo+QAF7D5bMItINDeI3W5Aab5mvS0Pun6BU3shk2rt6TQ3StZGeJrlQo ArPqohh4Ba4EkZxyBmEph7FkJwJZIm14SACInxYnXWZoTvxPaxXChzpKt+MlUwT9eJIq wrzE/nojYz9I1T3fy3Z0IIrhIwW7VSIa3N8jbHa3i+MGkhVHwmUwKKmAM9ehUOx6HTnk 92ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701873289; x=1702478089; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rBryz6FZsdnLWsHRkjZ3U4RVCZkoRYTCAAY+wIQJwm4=; b=GOD9ygpNaerccTh8JAMDLkbwNxgglI1cSVlDwmf9W2AIMBnFrPsYx1g8RCqfDEVSyL srmHV5dpGkTax249b3aMaiDHhQNaoX+FMyqMI7jdaHyviP7pPNZQQkLwTH+OlgrSwZ+A v29VoOac4OP7v1yyNlGqpY1SxYT9cnaT0idRzMp/L69fRlkXI03jgP6H46du5lWWThVi +ZjPUZX+NediJaqO5DJq3Y4gSAiJHhS92B7NTiMS8IJk4Oa9H4Q3wf9O1dlByFN7ntZt eymsz8ZTgmuXmlZyykS1Be/I52vJaSO/Z6WVOsywPRIQqBiJY2pmkHqiLaoqlTWrourt O7YQ== X-Gm-Message-State: AOJu0Yzjd3JsLP6FiHjxza3Vd9IgkFi8PBv6rMqE49YVyuoSaXT5V14m lz+8hrQu49+8iV3cSikIvRM3eyuiiGUOeA== X-Received: by 2002:a05:600c:a42:b0:40c:78c:f864 with SMTP id c2-20020a05600c0a4200b0040c078cf864mr662682wmq.16.1701873289154; Wed, 06 Dec 2023 06:34:49 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:bf3:71a0:e0cc:77ff:fe8c:d79a]) by smtp.gmail.com with ESMTPSA id d13-20020a05600c34cd00b0040b540ff0a5sm22297736wmq.19.2023.12.06.06.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 06:34:48 -0800 (PST) From: Gwenole Beauchesne <gb.devel@gmail.com> To: gcc-patches@gcc.gnu.org Cc: Gwenole Beauchesne <gb.devel@gmail.com> Subject: [PATCH] libstdc++: Fix testsuite with -Wformat Date: Wed, 6 Dec 2023 15:34:44 +0100 Message-Id: <20231206143444.2760326-1-gb.devel@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784543516359304173 X-GMAIL-MSGID: 1784543516359304173 |
Series |
libstdc++: Fix testsuite with -Wformat
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Gwenole Beauchesne
Dec. 6, 2023, 2:34 p.m. UTC
Tested on x86_64-pc-linux-gnu with --enable-languages=c,c++ and
additional -Wformat to CXXFLAGS.
-- >8 --
Fix testsuite when compiling with -Wformat. Use nonnull arguments so
that -Wformat does not cause extraneous output to be reported as an
error.
FAIL: tr1/8_c_compatibility/cinttypes/functions.cc (test for excess errors)
libstdc++-v3/ChangeLog:
* testsuite/tr1/8_c_compatibility/cinttypes/functions.cc: Use
nonnull arguments to strtoimax() and wcstoimax() functions.
Signed-off-by: Gwenole Beauchesne <gb.devel@gmail.com>
---
.../testsuite/tr1/8_c_compatibility/cinttypes/functions.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 06/12/23 15:34 +0100, Gwenole Beauchesne wrote: >Tested on x86_64-pc-linux-gnu with --enable-languages=c,c++ and >additional -Wformat to CXXFLAGS. Please CC the libstdc++@gcc.gnu.org list on all libstdc++ patches, as documented at https://gcc.gnu.org/lists.html Otherwise I won't see the patches unless I happen to glance at the gcc-patches archive by chance. The patch seems OK, but what exactly is it fixing? I don't see any warning when adding -Wformat to the test flags. >-- >8 -- > >Fix testsuite when compiling with -Wformat. Use nonnull arguments so >that -Wformat does not cause extraneous output to be reported as an >error. > >FAIL: tr1/8_c_compatibility/cinttypes/functions.cc (test for excess errors) > >libstdc++-v3/ChangeLog: > > * testsuite/tr1/8_c_compatibility/cinttypes/functions.cc: Use > nonnull arguments to strtoimax() and wcstoimax() functions. > >Signed-off-by: Gwenole Beauchesne <gb.devel@gmail.com> >--- > .../testsuite/tr1/8_c_compatibility/cinttypes/functions.cc | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc >index 518ddf49875..21f5263b5cc 100644 >--- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc >+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc >@@ -29,10 +29,10 @@ void test01() > #if _GLIBCXX_USE_C99_INTTYPES_TR1 > > std::tr1::intmax_t i = 0, numer = 0, denom = 0, base = 0; >- const char* s = 0; >+ const char* s = "0"; > char** endptr = 0; > #if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 >- const wchar_t* ws = 0; >+ const wchar_t* ws = L"0"; > wchar_t** wendptr = 0; > #endif >
On Fri, 5 Jan 2024 at 14:12, Jonathan Wakely wrote: > > On 06/12/23 15:34 +0100, Gwenole Beauchesne wrote: > >Tested on x86_64-pc-linux-gnu with --enable-languages=c,c++ and > >additional -Wformat to CXXFLAGS. > > Please CC the libstdc++@gcc.gnu.org list on all libstdc++ patches, as > documented at https://gcc.gnu.org/lists.html > > Otherwise I won't see the patches unless I happen to glance at the > gcc-patches archive by chance. > > The patch seems OK, but what exactly is it fixing? I don't see any > warning when adding -Wformat to the test flags. I've pushed the patch to trunk, but I'm still curious why I don't see warnings. > > >-- >8 -- > > > >Fix testsuite when compiling with -Wformat. Use nonnull arguments so > >that -Wformat does not cause extraneous output to be reported as an > >error. > > > >FAIL: tr1/8_c_compatibility/cinttypes/functions.cc (test for excess errors) > > > >libstdc++-v3/ChangeLog: > > > > * testsuite/tr1/8_c_compatibility/cinttypes/functions.cc: Use > > nonnull arguments to strtoimax() and wcstoimax() functions. > > > >Signed-off-by: Gwenole Beauchesne <gb.devel@gmail.com> > >--- > > .../testsuite/tr1/8_c_compatibility/cinttypes/functions.cc | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > >diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc > >index 518ddf49875..21f5263b5cc 100644 > >--- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc > >+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc > >@@ -29,10 +29,10 @@ void test01() > > #if _GLIBCXX_USE_C99_INTTYPES_TR1 > > > > std::tr1::intmax_t i = 0, numer = 0, denom = 0, base = 0; > >- const char* s = 0; > >+ const char* s = "0"; > > char** endptr = 0; > > #if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 > >- const wchar_t* ws = 0; > >+ const wchar_t* ws = L"0"; > > wchar_t** wendptr = 0; > > #endif > > >
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc index 518ddf49875..21f5263b5cc 100644 --- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cinttypes/functions.cc @@ -29,10 +29,10 @@ void test01() #if _GLIBCXX_USE_C99_INTTYPES_TR1 std::tr1::intmax_t i = 0, numer = 0, denom = 0, base = 0; - const char* s = 0; + const char* s = "0"; char** endptr = 0; #if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 - const wchar_t* ws = 0; + const wchar_t* ws = L"0"; wchar_t** wendptr = 0; #endif