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

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

 



On Mon, Mar 4, 2024, at 12:17 AM, Peter Johansson wrote:
> This is with autoconf 2.72 and GCC 9.4.0.
> I try to configure a project with
>
> ./configure 'CXX=c++ -std=c++2a'
>
> but the configure seems to dislike that because it outputs
>
> checking whether the compiler supports GNU C++... yes
> checking whether c++ -std=c++2a accepts -g... yes
> checking for c++ -std=c++2a option to enable C++11 features... -std=gnu++11
> checking dependency style of c++ -std=c++2a -std=gnu++11... gcc3
>
> So it decides to add -std=gnu++11.

Yeah, the logic for selecting a version of the C++ standard is inflexible
at the moment.  It always tries to force the highest standard that it
already knows about -- and right now that's C++ 2011, no higher.
(At the time 2.72 was released, the 202x C and C++ standards were still
in flux so we elected not to add support for them.)  Making it more
flexible -- specifically, allowing the project to declare which version
of the standard they want to use -- is tracked as
<https://savannah.gnu.org/support/index.php?110286>.

Also, what we currently have assumes that code that's valid in C++ XXXX
will _remain_ valid in C++ YYYY, where YYYY > XXXX.  That used to be
reliably true but the 202x standard drafts broke it.  That's why the
test program threw the error you quoted...

> conftest.cpp: In function 'int main(int, char**)':
> conftest.cpp:199:22: error: invalid conversion from 'const char8_t*' to
> 'const char*' [-fpermissive]
>   199 |   char const *utf8 = u8"UTF-8 string \u2500";

Fixing these things is a high priority for Autoconf 2.73 but nobody
currently has time to work on it.  If you have time, we would
appreciate your working on it -- even just a rough draft of revised
test programs would be helpful.

zw




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

  Powered by Linux