Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - uncaught_exception doesn't work with Dinkumware: (1 Item)
   
uncaught_exception doesn't work with Dinkumware  
The std::uncaught_exception() function seems to always return 0 when using the Dinkumware library on QNX 6.6.0. 
Attaching a code example from http://en.cppreference.com/w/cpp/error/uncaught_exception.

When compiled with the default Dinkumware library:
qcc -o uncaught_exception_test2.o "..\\uncaught_exception_test2.cpp" -V4.7.3,gcc_ntoarmv7le -w1 -c -O0 -g 
qcc -o uncaught_exception_test2 uncaught_exception_test2.o -V4.7.3,gcc_ntoarmv7le -w1 -lang-c++ -g 

The results are wrong:
Exception thrown
~Foo() called normally
Exception caught: test exception
~Foo() called normally

The problem exists on both x86 and armv7.

When compiled with GNU libstdc++:
qcc -o uncaught_exception_test2.o "..\\uncaught_exception_test2.cpp" -V4.7.3,gcc_ntoarmv7le_gpp -w1 -c -O0 -g 
qcc -o uncaught_exception_test2 uncaught_exception_test2.o -V4.7.3,gcc_ntoarmv7le_gpp -w1 -lang-c++ -g 

The results are correct:
Exception thrown
~Foo() called during stack unwinding
Exception caught: test exception
~Foo() called normally
Attachment: Text uncaught_exception_test2.cpp 565 bytes