This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Factor __aeabi_atexit into its own object file

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? :-)


Mark Mitchell
(650) 331-3385 x713

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]