From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id A863C385703C for ; Fri, 11 Sep 2020 13:37:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A863C385703C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-1QUDT2A0MBOGUtTOu7wysg-1; Fri, 11 Sep 2020 09:37:50 -0400 X-MC-Unique: 1QUDT2A0MBOGUtTOu7wysg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D70601084C8A; Fri, 11 Sep 2020 13:37:48 +0000 (UTC) Received: from localhost (unknown [10.33.37.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74E147DA20; Fri, 11 Sep 2020 13:37:48 +0000 (UTC) Date: Fri, 11 Sep 2020 14:37:47 +0100 From: Jonathan Wakely To: Christophe Lyon Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH] libstdc++-v3/include/bits/regex_error.h: Avoid warning with -fno-exceptions. Message-ID: <20200911133747.GS6061@redhat.com> References: <1599826987-5240-1-git-send-email-christophe.lyon@linaro.org> <20200911125513.GN6061@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200911125513.GN6061@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 13:37:53 -0000 On 11/09/20 13:55 +0100, Jonathan Wakely wrote: >On 11/09/20 12:23 +0000, Christophe Lyon via Libstdc++ wrote: >>When building with -fno-exceptions, __GLIBCXX_THROW_OR_ABORT expands to >>abort(), causing warnings: >>unused parameter '__ecode' >>unused parameter '__what' >> >>This patch adds __attribute__((unused)) to avoid them. > >OK, thanks. > >>2020-09-11 Torbjörn SVENSSON >> Christophe Lyon >> >> libstdc++-v3/ >> * include/bits/regex_error.h: Avoid warning with -fno-exceptions. >>--- >>libstdc++-v3/include/bits/regex_error.h | 3 ++- >>1 file changed, 2 insertions(+), 1 deletion(-) >> >>diff --git a/libstdc++-v3/include/bits/regex_error.h b/libstdc++-v3/include/bits/regex_error.h >>index 09e9288..88f3f811 100644 >>--- a/libstdc++-v3/include/bits/regex_error.h >>+++ b/libstdc++-v3/include/bits/regex_error.h >>@@ -167,7 +167,8 @@ namespace regex_constants >> __throw_regex_error(regex_constants::error_type __ecode); >> >> inline void >>- __throw_regex_error(regex_constants::error_type __ecode, const char* __what) >>+ __throw_regex_error(regex_constants::error_type __ecode __attribute__((unused)), Actually, not OK, because that needs to be __unused__ not unused. >>+ const char* __what__attribute__((unused))) And that fails to compile: /home/jwakely/src/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/regex_error.h:171:54: error: expected ‘,’ or ‘...’ before ‘(’ token There's a space missing between the name and the attribute. >> { _GLIBCXX_THROW_OR_ABORT(regex_error(__ecode, __what)); } >> >>_GLIBCXX_END_NAMESPACE_VERSION >>-- >>2.7.4 >>