Describe HP-UX cc bug workaround more accurately.
* lib/autoconf/types.m4 (AC_CHECK_SIZEOF): Cast to long,
not unsigned long.
* tests/semantics.at (AC_CHECK_SIZEOF): Check non-GCC
cross-compilers, too.
int
main (void)
@{
- static int test_array [(unsigned long) (sizeof (int)) == 4 ? 1 : -1];
+ static int test_array [sizeof (int) == 4 ? 1 : -1];
test_array [0] = 0
return 0;
@}
cc: "conftest.c": error 1879: Variable-length arrays cannot \
have static storage.
@end example
+
+Autoconf works around this problem by casting @code{sizeof (int)} to
+@code{long} before comparing it.
@end table
@node Generic Compiler Characteristics
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
- _AC_COMPUTE_INT([(unsigned long) (sizeof ($1))],
+ _AC_COMPUTE_INT([(long) (sizeof ($1))],
[AS_TR_SH([ac_cv_sizeof_$1])],
[AC_INCLUDES_DEFAULT([$3])],
[AC_MSG_ERROR([cannot compute sizeof ($1), 77])])
# AC_CHECK_SIZEOF
# ---------------
-# Cross-compiling: only with GCC, as some compilers, such as HP's
-# cannot grok our trick:
-#
-# static int test_array [1 - 2 * !(((unsigned long) (sizeof (unsigned char))) >= 0)];
-#
-# configure:3637: cc -c -Ae +O2 +Onolimit conftest.c >&5
-# cc: "configure", line 3660: error 1879: Variable-length arrays cannot have static storage.
-#
AT_CHECK_MACRO([AC_CHECK_SIZEOF],
[[# Exercize the code used when cross-compiling
-AC_PROG_CC
-if test "$GCC" != yes; then
- exit 77
-fi
cross_compiling=yes
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(charchar,,