From: Christophe Lyon Date: Fri, 11 Sep 2020 12:07:02 +0000 (+0000) Subject: libstdc++-v3/libsupc++/eh_call.cc: Avoid "set but not used" warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55bdee9af3cff04192c64a573fa1767b48918efa;p=gcc.git libstdc++-v3/libsupc++/eh_call.cc: Avoid "set but not used" warning 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 Christophe Lyon libstdc++-v3/ * libsupc++/eh_call.cc: Avoid warning with -fno-exceptions. --- diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc index d50c4fbf3c4..3c7426ec86d 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