octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #65327] octave 10 stores sets CXX wrong


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #65327] octave 10 stores sets CXX wrong
Date: Mon, 19 Feb 2024 12:08:20 -0500 (EST)

Follow-up Comment #3, bug#65327 (group octave):

The version of autoconf installed on my system is 2.71.  The latest is 2.72,
released in December 2023 and it appears to do the same thing when adding
flags to the C++ compiler variable CXX.  If I add "echo CXX: $CXX" before and
after the AC_PROG_CXX macro in configure.ac, regenerate the configure script,
and run configure with CXX="g++ -std=gnu++20", I see the following output:


CXX: g++ -std=gnu++20
checking whether the compiler supports GNU C++... yes
checking whether g++ -std=gnu++20 accepts -g... yes
checking for g++ -std=gnu++20 option to enable C++11 features... -std=gnu++11
checking dependency style of g++ -std=gnu++20 -std=gnu++11... gcc3
CXX: g++ -std=gnu++20 -std=gnu++11


So it is the autoconf AC_PROG_CXX macro that is adding the -std=gnu++11
option.  I haven't tried to decipher exactly what tests it is doing to decide
that it needs to add "-std=gnu++11" but the documentation for AC_PROG_CXX says
it will try to find options "to enable support for ISO Standard C++ features
with extensions, preferring the newest edition of the C++ standard that is
supported"

https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/C_002b_002b-Compiler.html#index-AC_005fPROG_005fCXX

Then, later in the configure script when we use


AX_CXX_COMPILE_STDCXX(17, [], [])


that macro is adding the -std=gnu++17 option to CXX.  Surrounded by "echo CXX:
$CXX" statements, it reports:


CXX: g++ -std=gnu++20 -std=gnu++11
checking whether g++ -std=gnu++20 -std=gnu++11 supports C++17 features by
default... no
checking whether g++ -std=gnu++20 -std=gnu++11 supports C++17 features with
-std=gnu++17... yes
CXX: g++ -std=gnu++20 -std=gnu++11 -std=gnu++17


I also haven't tried to understand why it rejects "g++ -std=gnu++20
-std=gnu++11" but accepts "g++ -std=gnu++20 -std=gnu++11 -std=gnu++17".

First, if multiple "-std=..." options are present, what does GCC do?  What
would clang++ or any other compiler do?

Anyway, these macros seem a bit broken for our purposes, unfortunately.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65327>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]