public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Christophe Lyon <christophe.lyon@linaro.org>
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.
Date: Fri, 11 Sep 2020 14:53:16 +0100	[thread overview]
Message-ID: <20200911135316.GT6061@redhat.com> (raw)
In-Reply-To: <20200911133747.GS6061@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

On 11/09/20 14:37 +0100, Jonathan Wakely wrote:
>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 <torbjorn.svensson@st.com>
>>>	Christophe Lyon  <christophe.lyon@linaro.org>
>>>
>>>	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.

Fixed with this patch. Untested, but it builds.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1087 bytes --]

commit 29216f56d002982f10c33056f4b3d7f07e164122
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Sep 11 14:51:36 2020

    libstdc++: Fix build error in <bits/regex_error.h>
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/regex_error.h (__throw_regex_error): Fix
            parameter declaration and use reserved attribute names.

diff --git a/libstdc++-v3/include/bits/regex_error.h b/libstdc++-v3/include/bits/regex_error.h
index 88f3f8114a4..f9c01650caa 100644
--- a/libstdc++-v3/include/bits/regex_error.h
+++ b/libstdc++-v3/include/bits/regex_error.h
@@ -167,8 +167,9 @@ namespace regex_constants
   __throw_regex_error(regex_constants::error_type __ecode);
 
   inline void
-  __throw_regex_error(regex_constants::error_type __ecode __attribute__((unused)),
-		      const char* __what__attribute__((unused)))
+  __throw_regex_error(regex_constants::error_type __ecode
+			__attribute__((__unused__)),
+		      const char* __what __attribute__((__unused__)))
   { _GLIBCXX_THROW_OR_ABORT(regex_error(__ecode, __what)); }
 
 _GLIBCXX_END_NAMESPACE_VERSION

      reply	other threads:[~2020-09-11 13:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 12:23 Christophe Lyon
2020-09-11 12:23 ` [PATCH] libstdc++-v3/libsupc++/eh_call.cc: " Christophe Lyon
2020-09-11 12:55   ` Jonathan Wakely
2020-09-11 12:23 ` [PATCH] libstdc++-v3/libsupc++/eh_call.cc: Avoid "set but not used" warning Christophe Lyon
2020-09-11 12:56   ` Jonathan Wakely
2020-09-11 12:55 ` [PATCH] libstdc++-v3/include/bits/regex_error.h: Avoid warning with -fno-exceptions Jonathan Wakely
2020-09-11 13:37   ` Jonathan Wakely
2020-09-11 13:53     ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200911135316.GT6061@redhat.com \
    --to=jwakely@redhat.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).