]> Savannah Git Hosting - gnulib.git/commitdiff
Avoid "warning: The macro `AC_PROG_CC_STDC' is obsolete".
authorBruno Haible <bruno@clisp.org>
Sun, 27 Sep 2020 19:56:10 +0000 (21:56 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 27 Sep 2020 21:45:48 +0000 (23:45 +0200)
Reported by Gavin Smith <gavinsmith0123@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00151.html>.

* m4/gnulib-common.m4 (gl_PROG_CC_C99): Use AC_PROG_CC_C99 or
AC_PROG_CC, depending on the Autoconf version.

ChangeLog
m4/gnulib-common.m4

index 428187f41931f221ece133a54d7385858aa644ce..cf7859dd9596df78332e13f20f2411730a35de30 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-09-27  Bruno Haible  <bruno@clisp.org>
+
+       Avoid "warning: The macro `AC_PROG_CC_STDC' is obsolete".
+       Reported by Gavin Smith <gavinsmith0123@gmail.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00151.html>.
+       * m4/gnulib-common.m4 (gl_PROG_CC_C99): Use AC_PROG_CC_C99 or
+       AC_PROG_CC, depending on the Autoconf version.
+
 2020-09-27  Gavin Smith  <gavinsmith0123@gmail.com>
 
        Avoid "warning: The macro `AC_HELP_STRING' is obsolete".
index a036454dbdb22aac23eca50fdac02b05188877a1..8a40713c07b6a759fa05be87284ec7465874e9c7 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 61
+# gnulib-common.m4 serial 62
 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,23 +483,17 @@ 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
-# - 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
-#   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00441.html>.
-# Remaining problems:
-# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
-#   to CC twice
-#   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00431.html>.
-# - 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])],
-    [AC_REQUIRE([AC_PROG_CC_STDC])])
+  dnl Just use AC_PROG_CC_C99.
+  dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted
+  dnl value of CC will contain the C99 enabling options twice. But this is only
+  dnl a cosmetic problem.
+  dnl With Autoconf >= 2.69c, use AC_PROG_CC since it implies AC_PROG_CC_C99;
+  dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete."
+  m4_version_prereq([2.69c],
+    [AC_REQUIRE([AC_PROG_CC])],
+    [AC_REQUIRE([AC_PROG_CC_C99])])
 ])
 
 # gl_PROG_AR_RANLIB