[Development] Enable Exceptions for Windows CE as default
olivier at woboq.com
Fri May 11 13:53:06 CEST 2012
On Friday 11 May 2012 11:01:38 shane.kearns at accenture.com wrote:
> You would also need to disable exceptions in STL.
> MSVC will link exception and no exception code without a warning.
> Exception thrown from exception handling DLL or object file to non exception
> using main() results in a crash and call to terminate()
> Exception thrown through a non exception handling DLL or object file is
> caught, but with intermediate destructors not called.
> i.e. with this proposal, if application code calls a Qt function inside a
> try block, and throws an exception from application code callback or plugin
> code, it may silently fail by catching the exception but the intermediate
> stack objects of the Qt code not having been cleaned up.
That is assuming those Qt functions as exceptions safe. But we don't really
offer such garentee anywere except in few QtCore classes. Most of the code is
not exception safe and will leak or produce undefined behaviour in case of
Exceptions are not supposed to cross the Qt layers. (Unless explicitly
documented as working)
Regarding the STL, the only sensible exception that might be thrown by the STL
is std::bad_alloc (The other ones are not supposed to happen). And handling
OOM error is IMHO pointless in a gui application (too difficult, unstested,
unreliable, don't get me started on this...)
Woboq - Qt services and support - http://woboq.com
More information about the Development