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

Bug#1016728: autoconf: _AC_PROG_CXX_STDCXX_EDITION_TRY test is broken due to typo



Package: autoconf
Version: 2.71-2
Severity: important
Tags: patch

Hi,

One of the changes to AC_PROG_CXX since 2.69 is that it now tries to
enable C++11 by default.  In most cases now that is a no-op since the
gcc default is already C++14, but I have some code that explicitly
forces -std=gnu++98 and which make it obvious this test is simply
failing "unnoticed" in the case where the compiler default isn't already
greater than C++11 ...

The problem is a simple typo in _AC_PROG_CXX_STDCXX_EDITION_TRY which
is fixed by the patch below.  Its correctness can be cross checked
against the behaviour and code of _AC_PROG_CC_STDC_EDITION_TRY where the
analogous variable is ac_cv_prog_cc_c$1 and which does work correctly
out of the box when the default (or explicitly set by CFLAGS) compiler
standard is something earlier than C11 ...

  Cheers,
  Ron



--- c.m4.orig	2022-08-06 18:54:47.444388264 +0930
+++ c.m4	2022-08-06 18:56:24.341810320 +0930
@@ -2749,8 +2749,8 @@
 [AC_REQUIRE([_AC_CXX_CXX$1_TEST_PROGRAM])]dnl
 [AS_IF([test x$ac_prog_cxx_stdcxx = xno],
 [AC_MSG_CHECKING([for $CXX option to enable C++$1 features])
-AC_CACHE_VAL(ac_cv_prog_cxx_$1,
-[ac_cv_prog_cxx_$1=no
+AC_CACHE_VAL([ac_cv_prog_cxx_cxx$1],
+[ac_cv_prog_cxx_cxx$1=no
 ac_save_CXX=$CXX
 AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][ac_cxx_conftest_cxx$1_program])
 for ac_arg in '' m4_normalize(m4_defn([_AC_CXX_CXX$1_OPTIONS]))


Reply to: