libstdc++-v3/include/bits/regex_error.h: Avoid warning with -fno-exceptions.
authorChristophe Lyon <christophe.lyon@linaro.org>
Fri, 11 Sep 2020 11:53:15 +0000 (11:53 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Fri, 11 Sep 2020 13:00:13 +0000 (13:00 +0000)
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.

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

index 09e9288788c94ec59b3d33a7a1a6e240a9969c58..88f3f8114a4388d6f504aef382dae4c678defb1a 100644 (file)
@@ -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)),
+                     const char* __what__attribute__((unused)))
   { _GLIBCXX_THROW_OR_ABORT(regex_error(__ecode, __what)); }
 
 _GLIBCXX_END_NAMESPACE_VERSION