summaryrefslogtreecommitdiff
path: root/lib/autoconf/headers.m4
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2020-10-09 09:02:47 -0400
committerZack Weinberg <zackw@panix.com>2020-10-10 11:23:09 -0400
commit326c9a547423d25c621bc5c0ef76edbf6eda8c92 (patch)
treed98731fcaf9ca5a5fecb7e3c77d487c607a84d82 /lib/autoconf/headers.m4
parent09346f1a776b1bba3634f2d3ccf30460fc372d44 (diff)
downloadautoconf-326c9a547423d25c621bc5c0ef76edbf6eda8c92.tar.gz
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.
Diffstat (limited to 'lib/autoconf/headers.m4')
-rw-r--r--lib/autoconf/headers.m42
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 21b37197..3b97a185 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -776,7 +776,7 @@ AU_DEFUN([AC_USG],
[# Obsolete code to be removed.
AC_MSG_CHECKING([for BSD string and memory functions])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <strings.h>]],
- [[rindex(0, 0); bzero(0, 0);]])],
+ [[rindex("", 0); bzero(0, 0);]])],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_DEFINE(USG, 1,