[PATCH 5/5] add libcc1

Tom Tromey tromey@redhat.com
Tue Jun 24 17:12:00 GMT 2014


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



More information about the Gcc-patches mailing list