Re: Selecting a C++ standard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 28, 2012 at 5:25 PM, Florian Weimer <fw@xxxxxxxxxxxxx> wrote:
> * Roger Leigh:
>
>> I would propose to add:
>>
>> AC_PROG_CXX_STDCXX
>> AC_PROG_CXX_CXX98
>> AC_PROG_CXX_CXXTR1 [CXX98 with additional checks for TR1 headers]
>> AC_PROG_CXX_CXX11
>>
>> With behaviour the same as the existing C macros.
>
> This would be unwise because picking the most recent
> compiler-supported standard will likely break programs on GNU/Linux.
> Switching from C++98 to C++11 changes the ABI of standard library
> templates, so it's basically an all-or-nothing choice for the entire
> system.  (Other language changes can break compilation, but these are
> less obnoxious and easier to work around.)

ABI break by gcc-4.7.0 and 4.7.1 in c++11 mode was a bug (or
misfeature, call it as you want).  Fixed in gcc-4.7.2.
>From http://gcc.gnu.org/gcc-4.7/changes.html :

    o  GCC versions 4.7.0 and 4.7.1 had changes to the C++ standard
       library which affected the ABI in C++11 mode: a data member was
       added to std::list changing its size and altering the
       definitions of some member functions, and std::pair's move
       constructor was non-trivial which altered the calling
       convention for functions with std::pair arguments or return
       types. The ABI incompatibilities have been fixed for GCC
       version 4.7.2 but as a result C++11 code compiled with GCC
       4.7.0 or 4.7.1 may be incompatible with C++11 code compiled
       with different GCC versions and with C++98/C++03 code compiled
       with any version.

-- 
Andrew W. Nosenko <andrew.w.nosenko@xxxxxxxxx>

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux