From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by sourceware.org (Postfix) with ESMTPS id C51FA3858D1E; Thu, 7 Sep 2023 19:30:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C51FA3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.mail.kapsi.fi Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kapsi.fi DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=X5+terjs+lhKIGp1xXIqngX4cRZcAk6sddnKnDGuC3Q=; b=hZpuG+7elq9UgW8E+m8KAePHoi oLu2RmOIVQUlz/WVSVazrfE+ItLK7Az5Jigk6j82mhswwv64Pqw1HuDXKTVCAGn0SqsHyit0b/j0R vQUi6tWVuX2cjNvj2O5FAjpqfTPMswa8eEpMI8/gSjWG7V8d68fsDgYL67yl5IjUyIyloOGkF2rFR oIE9Nlp9iU+eNPNpWQ+6v6Fw8RBk4VcJXRHC9Cz6/SOqJbioHnjeDX7lKqE759zdIqsgDKLjbB/A/ NEnH7wNezQUL8SbOZQp9Uqq8n7WGWYAo2yVkEEZmGRiVV+CkJtq3JnI1/7k+d3tOb2gEcAtepjmhR dz58pA8g==; Received: from 84-231-125-196.elisa-mobile.fi ([84.231.125.196] helo=[172.16.1.20]) by mail.kapsi.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1qeKhV-007YWo-2W; Thu, 07 Sep 2023 22:30:01 +0300 Message-ID: <93b18ce6-aef3-4d0b-becc-a301aa8bb84d@gcc.mail.kapsi.fi> Date: Thu, 7 Sep 2023 22:30:00 +0300 MIME-Version: 1.0 Subject: [PATCH v2] libstdc++: Fix -Wunused-parameter warnings To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org References: Content-Language: en-US From: =?UTF-8?Q?Pekka_Sepp=C3=A4nen?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 84.231.125.196 X-SA-Exim-Mail-From: pexu@gcc.mail.kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 7.9.2023 19:40, Jonathan Wakely wrote: > On 29/08/23 15:04 +0300, Pekka Seppänen wrote: >> libstdc++: Fix -Wunused-parameter warnings when _GLIBCXX_USE_WCHAR_T is >> not defined. >> >> libstdc++-v3/ChangeLog: >> >>     * src/c++11/cow-locale_init.cc: Add [[maybe_unused]] attribute. >>     * src/c++17/fs_path.cc (path::_S_convert_loc): Likewise. >>     * src/filesystem/path.cc (path::_S_convert_loc): Likewise. >> --- >>  libstdc++-v3/src/c++11/cow-locale_init.cc | 4 ++-- >>  libstdc++-v3/src/c++17/fs_path.cc         | 2 +- >>  libstdc++-v3/src/filesystem/path.cc       | 2 +- >>  3 files changed, 4 insertions(+), 4 deletions(-) >> >> mbstate_t>>(__loc); >> >> diff --git a/libstdc++-v3/src/c++11/cow-locale_init.cc >> b/libstdc++-v3/src/c++11/cow-locale_init.cc >> index 85277763427..9554ed1ebf9 100644 >> --- a/libstdc++-v3/src/c++11/cow-locale_init.cc >> +++ b/libstdc++-v3/src/c++11/cow-locale_init.cc >> @@ -137,8 +137,8 @@ namespace >>    } >> >>    void >> -  locale::_Impl::_M_init_extra(void* cloc, void* clocm, >> -                               const char* __s, const char* __smon) >> +  locale::_Impl::_M_init_extra(void* cloc, [[maybe_unused]] void* >> clocm, >> +                   const char* __s, [[maybe_unused]] const char* __smon) > > This line should be split to keepo it below 80 columns. > Done, v2 follows. > Otherwise the patch looks good, but please CC the libstdc++ list for > libstdc++ patches. Otherwise I won't see them, and they won't be > reviewed. > My bad, I wasn't aware of this. > Do you have a GCC copyright assignment on file? If not, please add a > sign-off to confirm you can submit this under the DCO terms: > https://gcc.gnu.org/dco.html > Will add. > >>    { >>      auto& __cloc = *static_cast<__c_locale*>(cloc); >> >> diff --git a/libstdc++-v3/src/c++17/fs_path.cc >> b/libstdc++-v3/src/c++17/fs_path.cc >> index aaea7d2725d..d65b5482e8b 100644 >> --- a/libstdc++-v3/src/c++17/fs_path.cc >> +++ b/libstdc++-v3/src/c++17/fs_path.cc >> @@ -1947,7 +1947,7 @@ path::_M_split_cmpts() >> >>  path::string_type >>  path::_S_convert_loc(const char* __first, const char* __last, >> -             const std::locale& __loc) >> +             [[maybe_unused]] const std::locale& __loc) >>  { >>  #if _GLIBCXX_USE_WCHAR_T >>    auto& __cvt = std::use_facet> mbstate_t>>(__loc); >> diff --git a/libstdc++-v3/src/filesystem/path.cc >> b/libstdc++-v3/src/filesystem/path.cc >> index 4c218bdae49..d04ba6d465d 100644 >> --- a/libstdc++-v3/src/filesystem/path.cc >> +++ b/libstdc++-v3/src/filesystem/path.cc >> @@ -498,7 +498,7 @@ path::_M_trim() >> >>  path::string_type >>  path::_S_convert_loc(const char* __first, const char* __last, >> -             const std::locale& __loc) >> +             [[maybe_unused]] const std::locale& __loc) >>  { >>  #if _GLIBCXX_USE_WCHAR_T >>    auto& __cvt = std::use_facet > -- >8 -- libstdc++: Fix -Wunused-parameter warnings when _GLIBCXX_USE_WCHAR_T is not defined. libstdc++-v3/ChangeLog: * src/c++11/cow-locale_init.cc: Add [[maybe_unused]] attribute. * src/c++17/fs_path.cc (path::_S_convert_loc): Likewise. * src/filesystem/path.cc (path::_S_convert_loc): Likewise. Signed-off-by: Pekka Seppänen --- libstdc++-v3/src/c++11/cow-locale_init.cc | 5 +++-- libstdc++-v3/src/c++17/fs_path.cc | 2 +- libstdc++-v3/src/filesystem/path.cc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/src/c++11/cow-locale_init.cc b/libstdc++-v3/src/c++11/cow-locale_init.cc index 85277763427..f48561f5b12 100644 --- a/libstdc++-v3/src/c++11/cow-locale_init.cc +++ b/libstdc++-v3/src/c++11/cow-locale_init.cc @@ -137,8 +137,9 @@ namespace } void - locale::_Impl::_M_init_extra(void* cloc, void* clocm, - const char* __s, const char* __smon) + locale::_Impl::_M_init_extra(void* cloc, [[maybe_unused]] void* clocm, + const char* __s, + [[maybe_unused]] const char* __smon) { auto& __cloc = *static_cast<__c_locale*>(cloc); diff --git a/libstdc++-v3/src/c++17/fs_path.cc b/libstdc++-v3/src/c++17/fs_path.cc index aaea7d2725d..d65b5482e8b 100644 --- a/libstdc++-v3/src/c++17/fs_path.cc +++ b/libstdc++-v3/src/c++17/fs_path.cc @@ -1947,7 +1947,7 @@ path::_M_split_cmpts() path::string_type path::_S_convert_loc(const char* __first, const char* __last, - const std::locale& __loc) + [[maybe_unused]] const std::locale& __loc) { #if _GLIBCXX_USE_WCHAR_T auto& __cvt = std::use_facet>(__loc); diff --git a/libstdc++-v3/src/filesystem/path.cc b/libstdc++-v3/src/filesystem/path.cc index 4c218bdae49..d04ba6d465d 100644 --- a/libstdc++-v3/src/filesystem/path.cc +++ b/libstdc++-v3/src/filesystem/path.cc @@ -498,7 +498,7 @@ path::_M_trim() path::string_type path::_S_convert_loc(const char* __first, const char* __last, - const std::locale& __loc) + [[maybe_unused]] const std::locale& __loc) { #if _GLIBCXX_USE_WCHAR_T auto& __cvt = std::use_facet>(__loc); -- 2.42.0