Re: [AD] Exception Support for Allegro

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Chris wrote:

Allegro is a C library. You cannot safely use exceptions from callbacks.

These two statements have nothing to do with each other. Just because it's C doesn't make exceptions unsafe in callbacks. You can use -fexceptions to safely allow exceptions in callbacks from C. It's where/how those callbacks are used that matters, and that makes no difference if it's C or C++.

It DOES make exceptions unsafe. C++ is famous for the lack of common ABI
supported by all compilers, each of the compilers has (or at least can
have) its own exception handling implementation. Not to mention even
more trivial things, they even do not have a common naming conventions.
Even mentioning the possibility of throwing exceptions from the
callbacks opens pandorra's box. They might work sometimes, but the
program might die horribly as well. Or you would better like to have
allegro dll refuse to load when the program is compiled with different
compiler (it can be achieved by exporting some C++ mangled symbol) just
to have this throwing exceptions from callbacks feature?

And for mingw even throwing exceptions across DLL boundary is a problem
(link to a relatively fresh post from mingw mailing list):
http://gcc.gnu.org/ml/java/2005-08/msg00138.html

If Dustin wants to throw exceptions from callbacks, he can build his
custom version of allegro library and *statically* link to it.





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/