diff mbox series

libstdc++-v3/libsupc++/eh_call.cc: Avoid "set but not used" warning

Message ID 1599826987-5240-3-git-send-email-christophe.lyon@linaro.org
State New
Headers show
Series libstdc++-v3/libsupc++/eh_call.cc: Avoid "set but not used" warning | expand

Commit Message

Christophe Lyon Sept. 11, 2020, 12:23 p.m. UTC
When building with -fno-exceptions, bad_exception_allowed is set but
not used, causing a warning during the build.

This patch adds __attribute__((unused)) to avoid it.

2020-09-11  Torbjörn SVENSSON  <torbjorn.svensson@st.com>
	Christophe Lyon  <christophe.lyon@linaro.org>

	libstdc++-v3/
	* libsupc++/eh_call.cc: Avoid warning with -fno-exceptions.
---
 libstdc++-v3/libsupc++/eh_call.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Wakely Sept. 11, 2020, 12:56 p.m. UTC | #1
On 11/09/20 12:23 +0000, Christophe Lyon via Libstdc++ wrote:
>When building with -fno-exceptions, bad_exception_allowed is set but
>not used, causing a warning during the build.
>
>This patch adds __attribute__((unused)) to avoid it.

OK, thanks.

>2020-09-11  Torbjörn SVENSSON  <torbjorn.svensson@st.com>
>	Christophe Lyon  <christophe.lyon@linaro.org>
>
>	libstdc++-v3/
>	* libsupc++/eh_call.cc: Avoid warning with -fno-exceptions.
>---
> libstdc++-v3/libsupc++/eh_call.cc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc
>index d50c4fb..3c7426e 100644
>--- a/libstdc++-v3/libsupc++/eh_call.cc
>+++ b/libstdc++-v3/libsupc++/eh_call.cc
>@@ -124,7 +124,7 @@ __cxa_call_unexpected(void* exc_obj_in)
>       void* new_ptr = __get_object_from_ambiguous_exception (new_xh);
>       const std::type_info* catch_type;
>       int n;
>-      bool bad_exception_allowed = false;
>+      bool bad_exception_allowed __attribute__((unused)) = false;
>       const std::type_info& bad_exc = typeid(std::bad_exception);
>
>       // Check the new exception against the rtti list
>-- 
>2.7.4
>
diff mbox series

Patch

diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc
index d50c4fb..3c7426e 100644
--- a/libstdc++-v3/libsupc++/eh_call.cc
+++ b/libstdc++-v3/libsupc++/eh_call.cc
@@ -124,7 +124,7 @@  __cxa_call_unexpected(void* exc_obj_in)
       void* new_ptr = __get_object_from_ambiguous_exception (new_xh);
       const std::type_info* catch_type;
       int n;
-      bool bad_exception_allowed = false;
+      bool bad_exception_allowed __attribute__((unused)) = false;
       const std::type_info& bad_exc = typeid(std::bad_exception);
 
       // Check the new exception against the rtti list