]> git.ipfire.org Git - thirdparty/autoconf.git/commit
Fix regressions when using the C++ compiler to perform tests.
authorZack Weinberg <zackw@panix.com>
Fri, 9 Oct 2020 13:02:47 +0000 (09:02 -0400)
committerZack Weinberg <zackw@panix.com>
Sat, 10 Oct 2020 15:23:09 +0000 (11:23 -0400)
commit326c9a547423d25c621bc5c0ef76edbf6eda8c92
treed98731fcaf9ca5a5fecb7e3c77d487c607a84d82
parent09346f1a776b1bba3634f2d3ccf30460fc372d44
Fix regressions when using the C++ compiler to perform tests.

The Debian project has done an archive rebuild using autoconf 2.69c,
which found several serious regressions from 2.69 where test programs
used to be accepted by a C++ compiler, but are now rejected.  Part of
the problem is that newer C++ compilers are more likely to reject
“traditional” sloppy C, but part of it is that bug fixes since 2.69
did not consider the possibility of test macros being used with
AC_LANG([C++]) in effect.

I’m still working on test suite improvements that will catch these
regressions in the future, but I don’t see any reason to delay the
actual bugfixes.  (I’ve gotten far enough on the test suite changes
that I know they _will_ catch the bugs.)

* NEWS: Document that AC_FUNC_STRERROR_R no longer tries to detect a
  strerror_r that exists in the C library but isn’t declared by string.h.

* lib/autoconf/c.m4
  (AC_LANG_CALL(C++)): New macro.  Use a more robust technique for
  avoiding a type conflict with any intrinsic prototype.
  (AC_LANG_CALL(C)): Remove #ifdef __cplusplus, this macro is no longer
  used to generate C++ code.

* lib/autoconf/functions.m4
  (AC_FUNC_CLOSEDIR_VOID): Rely on <dirent.h> to declare closedir.
  Simplify test program.  Use AC_COMPILE_IFELSE, not AC_RUN_IFELSE.
  (_AC_FUNC_MALLOC_IF, _AC_FUNC_REALLOC_IF): Use void *, not char *,
  for variable holding a value returned by malloc/realloc respectively.
  (AC_FUNC_STRERROR_R): Don’t AC_CHECK_FUNCS_ONCE strerror_r.
  AC_DEFINE HAVE_STRERROR_R if and only if we are also going to define
  HAVE_DECL_STRERROR_R.  Remove AC_RUN_IFELSE fallback when strerror_r
  is not declared.

* lib/autoconf/headers.m4 (AC_USG): Use "", not 0, for the first
  argument to rindex.
NEWS
lib/autoconf/c.m4
lib/autoconf/functions.m4
lib/autoconf/headers.m4