PATCH: Factor __aeabi_atexit into its own object file

Mark Mitchell mark@codesourcery.com
Tue May 8 20:09:00 GMT 2007


Paolo Carlini wrote:
> Mark Mitchell wrote:
> 
>> __attribute__((nothrow)) is the C equivalent of "throw ()".  In C++
>> programs, you should just use "throw()", but in C programs, you can use
>> "__attribute__((nothrow))".  Of course, in C, this only matters if
>> you're using -fexceptions so that you can unwind through C code.
>>  
>>
> I see, in fact the specific thing I'm not familiar with is unwinding
> through C code...

Ah, I see.  If you compile C code with -fexceptions, GCC generates the
same kind of EH information it would for C++.  You can't throw an
exception from C code, but the compiler emits enough information to
unwind the stack through the C code.  So, if your C++ application calls
a C function that calls a C++ function, and that last function throws an
exception, the right thing happens: your original function can catch it.

> Thanks a lot about the many additional details and explanations!

So, is the patch OK? :-)

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Libstdc++ mailing list