Re: configure adds -std=gnu++11 to CXX variable

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

 



On Tue, 28 May 2024, 07:24 Florian Weimer via Gcc, <gcc@xxxxxxxxxxx> wrote:

> * Paul Eggert:
>
> > On 2024-05-27 03:35, Florian Weimer wrote:
> >> Does this turn on experimental language modes by default?  That's
> >> probably not what we want.
> >
> > What do C++ developers want these days? Autoconf should have a
> > reasonable default, and C++11 is surely not a good default anymore.
>
> It's still a good default for GCC 5.
>
> GCC developers will correct me, but I think the default C++ dialect is
> updated to a newer version once the implementation is reasonably
> complete and bugs have been ironed out.
>

Correct.

Please DO NOT default to C++20 for any current version of GCC, that's an
ABI disaster waiting to happen. There is no version of GCC with stable
C++20 support.



> This is different from the C front end, where it took close to 40 years
> (from the introduction of void * into C) to activate type checking for
> pointer types by default.
>
> >> It would be better to have an option to raise the C++ mode to at least a
> >> certain revision, and otherwise use the default.
> >
> > That option is already available. For example, a builder who doesn't
> > want C++23 can use './configure ac_cv_prog_cxx_cxx23=no', and a
> > developer can discourage C++23 by putting ':
> > ${ac_cv_prog_cxx_cxx23=no}' early in configure.ac.
>

It should not be opt out.

But if you make this change I'll very loudly suggest that everybody use
that in every autoconf-based C++ program. Then you'll probably need some
other solution in 5 years to workaround the fact that that option is
ubiquitous and needs to be ignored or overridden because people want C++20
to be used




> But that is not the same thing.  If a project uses C++14 constructs,
> wouldn't it make sense to tell configure to try to get (likely
> experimental) support for it if the compiler does not enable C++14 by
> default?  And if the system is already at C++17, leave it at that?
>
> Setting C++14 unconditionally could be incompatible with used system
> libraries, which assume C++17 support because the distribution is aware
> that the system compiler supports C++17.
>
> Thanks,
> Florian
>
>



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

  Powered by Linux