]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/c.m4 (AC_C_INLINE): Do not skip cleanup code.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 3 Apr 2006 19:09:55 +0000 (19:09 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 3 Apr 2006 19:09:55 +0000 (19:09 +0000)
(AC_C_RESTRICT): Likewise.  Furthermore, add a function with a
typedef'ed restricted pointer, to catch a compiler bug on
HP-UX 11.x, and fix warnings so it passes with -Werror.
(_AC_PROG_CC_C99): Likewise.
Reported by Albert Chin <china@thewrittenword.com>.
* tests/mktests.sh: Do not skip AC_C_INLINE, AC_C_RESTRICT.

ChangeLog
lib/autoconf/c.m4
tests/mktests.sh

index 20f9b5a3c3f535f3b1f24b760daa263a6af90575..4fe0f790ce75c395d620931376c57785ba5bf027 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-04-03  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * lib/autoconf/c.m4 (AC_C_INLINE): Do not skip cleanup code.
+       (AC_C_RESTRICT): Likewise.  Furthermore, add a function with a
+       typedef'ed restricted pointer, to catch a compiler bug on
+       HP-UX 11.x, and fix warnings so it passes with -Werror.
+       (_AC_PROG_CC_C99): Likewise.
+       Reported by Albert Chin <china@thewrittenword.com>.
+       * tests/mktests.sh: Do not skip AC_C_INLINE, AC_C_RESTRICT.
+
 2006-04-03  Noah Misch  <noah@cs.caltech.edu>
 
        * bin/autoscan.in (subdirs): New global.
index cfc72096b952d6dffb965243a315d2073e4c74f8..962baeef469cd1708eed08875843126ca8c6c0bf 100644 (file)
@@ -1092,8 +1092,10 @@ struct named_init {
   double average;
 };
 
+typedef const char *ccp;
+
 static inline int
-test_restrict(const char *restrict text)
+test_restrict(ccp restrict text)
 {
   // See if C++-style comments work.
   // Iterate through items via the restricted pointer.
@@ -1169,6 +1171,9 @@ test_varargs(const char *format, ...)
 
   int dynamic_array[ni.number];
   dynamic_array[43] = 543;
+
+  // work around unused variable warnings
+  return  bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x';
 ]],
 dnl Try
 dnl GCC                -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999)
@@ -1397,7 +1402,8 @@ static $ac_kw foo_t static_foo () {return 0; }
 $ac_kw foo_t foo () {return 0; }
 #endif
 ])],
-                   [ac_cv_c_inline=$ac_kw; break])
+                   [ac_cv_c_inline=$ac_kw])
+  test "$ac_cv_c_inline" != no && break
 done
 ])
 AH_VERBATIM([inline],
@@ -1505,9 +1511,17 @@ AC_DEFUN([AC_C_RESTRICT],
    # Try the official restrict keyword, then gcc's __restrict, and
    # the less common variants.
    for ac_kw in restrict __restrict __restrict__ _Restrict; do
-     AC_COMPILE_IFELSE([AC_LANG_SOURCE(
-      [float * $ac_kw x;])],
-      [ac_cv_c_restrict=$ac_kw; break])
+     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+      [[typedef int * int_ptr;
+        int foo (int_ptr $ac_kw ip) {
+        return ip[0];
+       }]],
+      [[int s[1];
+        int * $ac_kw t = s;
+        t[0] = 0;
+        return foo(t)]])],
+      [ac_cv_c_restrict=$ac_kw])
+     test "$ac_cv_c_restrict" != no && break
    done
   ])
  case $ac_cv_c_restrict in
index 529459109c2db9441785b05109cb140bd17b9b36..1f702b766045c456f37a61ae4b70cd258c85bda6 100755 (executable)
@@ -121,7 +121,7 @@ exclude_list='^ac_cv_prog_(gcc|gxx|g77)$
 # - AC_FD_CC
 #   Is a number.
 #
-# - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE), AC_PATH_XTRA
+# - AC_PROG_CC, AC_C_(CONST|VOLATILE), AC_PATH_XTRA
 #   Checked in semantics.
 #
 # - AC_CYGWIN, AC_CYGWIN32, AC_EMXOS2, AC_MING32, AC_EXEEXT, AC_OBJEXT
@@ -155,7 +155,7 @@ ac_exclude_list='^AC_ARG_VAR$
 ^AC_SEARCH_LIBS$
 ^(AC_TRY.*|AC_RUN_LOG)$
 ^AC_.*_IFELSE$
-^(AC_(PROG_CC|C_CONST|C_INLINE|C_RESTRICT|C_VOLATILE))$
+^(AC_(PROG_CC|C_CONST|C_VOLATILE))$
 ^AC_(CYGWIN|CYGWIN32|EMXOS2|MING32|EXEEXT|OBJEXT)$
 ^AC_PATH_XTRA$
 ^AC_SYS_RESTARTABLE_SYSCALLS$