-fno-exceptions documentation

Peter Dimov pdimov@mmltd.net
Wed Dec 7 20:51:00 GMT 2005


Benjamin Kosnik wrote:
>> Thanks Peter.  That's a cleaner solution as it moves the #ifdef
>> __EXCEPTIONS out of op new and into throw_exception(), although we
>> might also want to pass a const char* to make it a little easier in
>> the non-throwing case, maybe not for bad_alloc... :-)
>
> Suggest you find
>
> include/bits/funcexcept.h
>
>> Anyway, if you come up with a way to pull this off without having to
>> recompile op new (or another part of the lib) when flipping
>> exceptions on/off, that would really be cool! (your challenge for the
>> week ;-)).
>
> Not possible.

Isn't there some __attribute__ magic that allows multiple function 
definitions coming from a header included in several translation units? 
(Similar to a template implicit instantiation.) This could allow a libstdc++ 
header to inject the appropriate definition of __throw_bad_alloc into user 
code. The library itself would contain no implementations. 



More information about the Libstdc++ mailing list