]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AC_FUNC_STRERROR_R: Include string.h in test program.
authorZack Weinberg <zackw@panix.com>
Thu, 5 Nov 2020 14:17:05 +0000 (09:17 -0500)
committerZack Weinberg <zackw@panix.com>
Thu, 5 Nov 2020 14:17:05 +0000 (09:17 -0500)
I misremembered how AC_LANG_PROGRAM works.  We don’t need to invoke
AC_INCLUDES_DEFAULT here but we *do* need to explicitly include
string.h.

Unfortunately we have no good way of testing for this regression with
the testsuite as it is today.

* lib/autoconf/functions.m4 (AC_FUNC_STRERROR_R): Include string.h in
  test program.

lib/autoconf/functions.m4

index e474984f692035295a40a36ef323bc6781580336..a91eeebc4949f3e7f62dc00b8dc9c49187103f73 100644 (file)
@@ -1699,7 +1699,7 @@ AC_CACHE_CHECK([whether strerror_r returns char *],
               [ac_cv_func_strerror_r_char_p], [
     ac_cv_func_strerror_r_char_p=no
     if test $ac_cv_have_decl_strerror_r = yes; then
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <string.h>],
        [[
          char buf[100];
          char x = *strerror_r (0, buf, sizeof buf);