Jump to content

Dynamic exceptions


Recommended Posts

We have found dynamic exceptions in SystemC. More than what the method throws we are concerned about deprecation of dynamic exception in next C++ versions. We see the issue can be solved for c++11 by replacing throw() with  noexcept instead. 


This will be egg and chicken problem with c++11 and c++03 :(. A compiler check can help to do this. Am I only crazy about c++11 ???


Regards, Sumit 

Link to comment
Share on other sites

As you may have noticed, only the exception-related SystemC classes (sc_report, sc_unwind_exception)  use exception specifications (and only the plain throw()).  These are required by C++03, see http://www.cplusplus.com/reference/exception/exception/.


Have you experienced problems (except for potential deprecation warnings) in C++11 mode on some compilers (clang?).  Can you share the compiler flags and the corresponding error messages?



Link to comment
Share on other sites

Only concern potential deprecation warnings, no other issue.


Compiler Flag for Clang :   



set ( CMAKE_CXX_FLAGS "-Wno-conversion -Wno-shorten-64-to-32 -Wno-implicit-fallthrough -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-padded -Wno-sign-conversion -pthread -Weverything -pedantic -std=c++11 -fPIC" )

set ( CMAKE_C_FLAGS "-Wno-conversion -Wno-shorten-64-to-32 -Wno-implicit-fallthrough -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-padded -Wno-sign-conversion -pthread -Weverything -fPIC" )


and you yourself can see the warnings. We are cleaning up warnings one by one.
Regards, Sumit
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...