This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/5] add libcc1
- From: Tom Tromey <tromey at redhat dot com>
- To: Trevor Saunders <tsaunders at mozilla dot com>
- Cc: Jeff Law <law at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Jun 2014 11:12:38 -0600
- Subject: Re: [PATCH 5/5] add libcc1
- Authentication-results: sourceware.org; auth=none
- References: <1400254001-12038-1-git-send-email-tromey at redhat dot com> <87oayx4l0x dot fsf at fleche dot redhat dot com> <87bntobp1f dot fsf at fleche dot redhat dot com> <20140620031058 dot GA12633 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com> <87vbrv8uje dot fsf at fleche dot redhat dot com> <53A87B75 dot 4090705 at redhat dot com> <20140624031231 dot GA1815 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com>
Trevor> hrm, I know basically nothing about the upcoming changes, but I would
Trevor> have expected linking c++03 code against c++11 code would be fine
Trevor> especially when the interface doesn't involve any stl.
https://gcc.gnu.org/wiki/Cxx11AbiCompatibility
This warns against mixing with C++98, which seems to be how GCC is
built.
While I agree that in this specific case it is probably safe, since gcc
in general isn't a heavy user of libstdc++, I think it's reasonable to
simply follow gcc. This is safer in case gcc changes; and the benefit
from C++11 in libcc1 is modest, especially when you consider the extra
template magic we'd need in order to actually use variadic templates for
the RPC stuff.
Trevor> Well, we build everything or at least everything I've seen with
Trevor> -fno-exceptions, so if something does throw we'll just crash right?
Trevor> istm we certainly write code calling the throwing new with that
Trevor> expectation.
Gcc's coding conventions say that code ought to be exception-safe in
case exceptions are used in the future. Search for "Exceptions" here:
https://gcc.gnu.org/wiki/CppConventions
I think retaining the std::nothrow is safer in view of this, and doesn't
cause any problems.
Tom