On 9/27/20 7:03 AM, Bruno Haible wrote:

I'll look into these today.
Thanks for looking into it. Before I saw your email I had come up with the attached patches but I will hold off on installing them as I don't want to get in your way.

The "m4_version_prereq([2.69.301-14265], ...)" in one of the patches indicates some of the portability problems here. Gnulib needs to work with Autoconf 2.69 and earlier (obviously), but we need to test it with Autoconf prereleases too. There are some longstanding "m4_version_prereq([2.70], ...)" calls in Gnulib that should probably be changed to "m4_version_prereq([2.69.301-14265], ...)" now, before Autoconf 2.70 comes out.

I am assuming that "m4_version_prereq([2.69.301-14265], ...)" does the right thing with Autoconf beta version numbers; if not, that's an Autoconf bug that should get fixed....
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 57343e440..4443a99ce 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 60
+# gnulib-common.m4 serial 61
 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -483,7 +483,11 @@ AC_DEFUN([gl_FEATURES_H],
 # gl_PROG_CC_C99
 # Modifies the value of the shell variable CC in an attempt to make $CC
 # understand ISO C99 source code.
-# This is like AC_PROG_CC_C99, except that
+# This macro's implementation is not quite right, since it attempts to
+# use the latest version of the C standard instead of using C99 only.
+# So far there has seemed little motivation to fix this, as later standards
+# have mostly been extensions to C99.
+# With Autoconf 2.69 and earlier this is like AC_PROG_CC_C99, except that
 # - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
 #   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>,
 #   but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
@@ -495,10 +499,8 @@ AC_DEFUN([gl_FEATURES_H],
 # - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
 AC_DEFUN([gl_PROG_CC_C99],
 [
-  dnl Change that version number to the minimum Autoconf version that supports
-  dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
-  m4_version_prereq([9.0],
-    [AC_REQUIRE([AC_PROG_CC_C99])],
+  m4_version_prereq([2.69.301-14265], dnl Change to 2.70 when 2.70 comes out.
+    [AC_REQUIRE([AC_PROG_CC])],
     [AC_REQUIRE([AC_PROG_CC_STDC])])
 ])
 
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index c1f8ea32f..c6d814220 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -15,7 +15,7 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
     [ac_cv_func_malloc_0_nonnull],
     [AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
-          [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+          [[#ifdef HAVE_STDLIB_H
             # include <stdlib.h>
             #else
             char *malloc ();
diff --git a/m4/realloc.m4 b/m4/realloc.m4
index 85b8f874f..561e98823 100644
--- a/m4/realloc.m4
+++ b/m4/realloc.m4
@@ -15,7 +15,7 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
     [ac_cv_func_realloc_0_nonnull],
     [AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
-          [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+          [[#ifdef HAVE_STDLIB_H
             # include <stdlib.h>
             #else
             char *realloc ();

Reply via email to