* 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.
This commit is contained in:
Ralf Wildenhues 2006-04-03 19:09:55 +00:00
parent 18c5d992f3
commit 7ff8451f9e
3 changed files with 31 additions and 7 deletions

View File

@ -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.

View 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

View File

@ -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$