This is the mail archive of the
mailing list for the GCC project.
True "no-exceptions" mode?
- From: Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- To: gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Sun, 18 May 2014 12:33:13 -0300
- Subject: True "no-exceptions" mode?
- Authentication-results: sourceware.org; auth=none
I am needing a truly exceptions-clean (or exceptions-free) binary due to
some embedding systems platform.
-fno-exceptions is not enough of course.
I am thinking about taking the concept to the backend through multilibs:
add some general -mno-exceptions or alike so there can be a selectable
multilib compiled without any kind of exceptions.
Of course that there should be more things of both front-end and
library addressed, such as:
- dynamic_cast of references shall not be permitted in this mode (so
no bad_cast is possible).
- .at() of containers disabled (e.g. vector::at())
- operator new shall be always nothrow
I am going to create a discussion in the C++ committee as well, but I also
wanted to create a discussion here.
My initial proposal here is: add a -mno-exceptions or alike so that
different multilibs can be
selected based on the presence/absence of this flag; then, it is
what a mulitlib "without exceptions" actually is. I'm now concerned in
the flag and providing
the selection mechanism only.
Of course once exceptions are addressed, RTTI will be the next feature.
Daniel F. Gutson
Chief Engineering Officer, SPD
San Lorenzo 47, 3rd Floor, Office 5
Phone: +54 351 4217888 / +54 351 4218211