You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
abieos.cpp produces 120 occurrences of warnings (out of 380) in a mandel build. Please see below for discussions on telegram.
Lin Huang, [Jun 30, 2022 at 1:50:47 PM]:
The following two warnings occur 120 times (out of 380 total) in a mandel build:
tests/abieos/src/abieos.cpp:40:13: warning: throw will always call terminate() [-Wterminate]
tests/abieos/src/abieos.cpp:45:13: warning: throw will always call terminate() [-Wterminate]
The offending code is
if (!catch_all)
throw;
while catch_all is defined as inline const bool catch_all = true;
As catch_all is a constant and I cannot find anywhere it is set to false, the throw is never executed. Is it safe to just remove catch_all and the if statement?
Bucky, [Jun 30, 2022 at 2:12:50 PM]:
I don't think it would be a problem to outright remove it.
But, you could also make the bool catch_all inline constexpr and do if constexpr instead. And check if a preprocessor define (maybe ABIEOS_CATCH_ALL) is defined and set to true or false accordingly.
I suspect this is there to help with debugging during development as it is will eat a lot of exceptions.
Actually the obverse is what you want. ABIEOS_NOT_CATCH_ALL so the default behavior can be to catch all.
Lin Huang, [Jun 30, 2022 at 2:29:08 PM]:
Thanks @larryk85 for your suggestions. They will get rid of the warnings, do it at compile time, and keep a way for debugging.
Matt Witherspoon, [Jun 30, 2022 at 2:35:32 PM]:
my hunch is it exists for when you embed abieos in to another language that won't be able to cope with c++ exceptions. think JNI etc
The text was updated successfully, but these errors were encountered:
linh2931
changed the title
warning: throw will always call terminate() in abieos.cpp
Compile warning: throw will always call terminate() in abieos.cpp
Jul 5, 2022
abieos.cpp
produces 120 occurrences of warnings (out of 380) in amandel
build. Please see below for discussions on telegram.Lin Huang, [Jun 30, 2022 at 1:50:47 PM]:
The following two warnings occur 120 times (out of 380 total) in a mandel build:
The offending code is
while
catch_all
is defined asinline const bool catch_all = true;
As
catch_all
is a constant and I cannot find anywhere it is set to false, the throw is never executed. Is it safe to just removecatch_all
and the if statement?Bucky, [Jun 30, 2022 at 2:12:50 PM]:
I don't think it would be a problem to outright remove it.
But, you could also make the bool catch_all inline constexpr and do if constexpr instead. And check if a preprocessor define (maybe
ABIEOS_CATCH_ALL
) is defined and set to true or false accordingly.I suspect this is there to help with debugging during development as it is will eat a lot of exceptions.
Actually the obverse is what you want.
ABIEOS_NOT_CATCH_ALL
so the default behavior can be to catch all.Lin Huang, [Jun 30, 2022 at 2:29:08 PM]:
Thanks @larryk85 for your suggestions. They will get rid of the warnings, do it at compile time, and keep a way for debugging.
Matt Witherspoon, [Jun 30, 2022 at 2:35:32 PM]:
my hunch is it exists for when you embed
abieos
in to another language that won't be able to cope with c++ exceptions. think JNI etcThe text was updated successfully, but these errors were encountered: