[cfe-dev] How to control C++0x adoption in a large codebase?

Jeffrey Yasskin jyasskin at google.com
Wed Oct 5 16:44:36 PDT 2011

On Wed, Oct 5, 2011 at 4:30 PM, John McCall <rjmccall at apple.com> wrote:
> On Oct 5, 2011, at 3:35 PM, Jeffrey Yasskin wrote:
>> I'm working on migrating a certain large codebase to C++0x, and we're
>> looking for a way to turn on C++0x mode but make sure people don't use
>> C++0x features before we're ready for them.
>> * We need to turn on -std=gnu++0x for the whole codebase at once
>> because C++98 and C++0x have different ABIs.
> As far as I'm aware, this is not really true, and I actually put a lot of
> effort into fighting a few committee proposals that would have forced
> ABI changes.  There are a few things like name mangling which have been
> changed/clarified in the Itanium ABI, and obviously the standard library
> has to export more symbols in '0x, but I don't know of well-formed '03
> programs that have changed.

http://gcc.gnu.org/PR45093 concludes that the libstdc++ maintainers
don't intend to maintain binary compatibility between the two language
versions. It certainly may be that it would have been possible to
maintain compatibility, but they didn't, so that's what we have to
live with. libc++ probably does this better, but we don't really want
to block constrained C++0x support on switching to that either.

> Now, obviously you can break binary compatibility with macro
> metaprogramming, but that's quite different.
> Anyway, I'm not opposed to an extension warning for using '0x features.

Thanks. :)

More information about the cfe-dev mailing list