View Issue Details

IDProjectCategoryView StatusLast Update
0001701OpenMPTlibopenmptpublic2023-05-07 07:48
Reportermanx Assigned Tomanx  
PrioritylowSeverityminorReproducibilityhave not tried
Status confirmedResolutionopen 
Product VersionOpenMPT 1.31.01.00 / libopenmpt 0.7.0 (upgrade first) 
Summary0001701: Autoconf 2.70 or later forcibly adds -std=gnu++11 to CXXFLAGS
Description

Autoconf, in their infinite wisdom, decided that it would be a good idea to break existing behaviour and invented forcing some arbitrary outdated C++ standard version from 2011 over the toolchain default. In 2020, Autoconf version 2.70. Magnificent decision.

See <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob;f=NEWS;h=ba418d1af5da752de77a2c388f9af56f8f1bf6a4;hb=97fbc5c184acc6fa591ad094eae86917f03459fa#l259>:

  • Noteworthy changes in release 2.70 (2020-12-08) [stable]
    [...]
    *** AC_PROG_CC now enables C2011 mode if the compiler supports it.

    If not, it will fall back to C99 and C89, as before. Similarly,
    AC_PROG_CXX now enables C++2011 if available, falling back on C++98.

There appears to be no documentation on how to avoid this or work-around it, if one requires a newer C++ standard. See <https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html#C_002b_002b-Compiler>:

If necessary, options are added to CXX to enable support for ISO Standard C++ features with extensions, preferring the newest edition of the C++ standard that is supported. Currently the newest edition Autoconf knows how to detect support for is ISO C++ 2011. After calling this macro, you can check whether the C++ compiler has been set to accept standard C++ by inspecting the shell variable ac_prog_cc_stdc. Its value will be ‘cxx11’ or ‘cxx98’, respectively, if the C++ compiler has been set to use the 2011 or 1990 edition of the C++ standard, and ‘no’ if the compiler does not support compiling standard C++ at all.

The established practice of choosing the desired C++ standard version with Autoconf has always been to use AX_CXX_COMPILE_STDCXX from the autoconf-archive package (<https://github.com/autoconf-archive/autoconf-archive/blob/master/m4/ax_cxx_compile_stdcxx.m4>), which is what libopenmpt does to check for C++20 support (or fall back to C++17 if C++20 is unavailable) (see <https://github.com/OpenMPT/openmpt/blob/libopenmpt-0.7.0/build/autotools/configure.ac#L26>).

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

manx

manx

2023-05-07 07:47

administrator   ~0005718

This is caused by upgrading the package building host from Debian 11 to Debian 12 for libopenmpt 0.7.

manx

manx

2023-05-07 07:47

administrator   ~0005719

MacPorts issue: https://github.com/macports/macports-ports/pull/17284#pullrequestreview-1415834125

manx

manx

2023-05-07 07:48

administrator   ~0005720

Autoconf issue: https://savannah.gnu.org/support/index.php?110879

manx

manx

2023-05-07 07:48

administrator   ~0005721

I am not aware of anything we could sensibly do here.

Issue History

Date Modified Username Field Change
2023-05-07 07:46 manx New Issue
2023-05-07 07:46 manx Status new => assigned
2023-05-07 07:46 manx Assigned To => manx
2023-05-07 07:47 manx Note Added: 0005718
2023-05-07 07:47 manx Note Added: 0005719
2023-05-07 07:48 manx Note Added: 0005720
2023-05-07 07:48 manx Note Added: 0005721
2023-05-07 07:48 manx Status assigned => confirmed