+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.
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.
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)
$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],
# 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
# - 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
^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$