This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: [v3] add -fno-exceptions support


>>>>> "Benjamin" == Benjamin Kosnik <bkoz@redhat.com> writes:

> 1) vec.cc:
> __cxa_vec_new2
>  - try/catch blocks
>  - __throw_exception_again
> 2) new_op.cc
>  - __throw_bad_alloc
> 3) new_opnt.cc
>  - try/catch blocks
> 4) exception_support.cc
>  - try/catch
>  - __throwXXX
>  - some stuff that's not needed for exceptions. Please double check
>    this file carefully jason.

> To me, this indicates that you need the functexcept.h header to
> correctly compile the runtime with -fno-exceptions. If not, please
> post a patch on how to do it otherwise.

It sounds like libsupc++ only needs the macros
(try/catch/__throw_exception_again) from that header, right?

BTW, I'd prefer an uppercase name for __throw_exception_again.  Perhaps
__RETHROW?

> The other issue is __cxa_bad_cast vs. __throw_bad_cast.

> The problem is that __cxa_bad_cast and __throw_bad_cast do pretty much
> the same thing: it makes sense to consolidate this stuff. Which begs
> the question, why do we have the __cxa_XXX versions? I don't see any
> reference to these functions in the actual ABI document (although I
> may be wrong--I'd expect to see them in 3.3.3)

They're in the EH document, which is separate.  A bit confusing, yes.

> If __cxa_bad_cast/__cxa_bad_typeid are required for the ABI, and I'm
> wrong, can't we just extend to __cxa_out_of_range etc and have all
> this stuff in one place?

I'd really rather not--again, libsupc++ provides the library for a
freestanding implementation.  This means clause 18 and any other hooks that
the compiler might call from generated code.

Anything which does not fall under that description does not belong in
libsupc++.

It's important to me that libsupc++ remain distinct from the rest of
libstdc++, so that a program that only uses clause 18 can just link with
libsupc++.

Jason


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