]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Specific Compiler Characteristics):
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Feb 2002 22:56:16 +0000 (22:56 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Feb 2002 22:56:16 +0000 (22:56 +0000)
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.

doc/autoconf.texi
lib/autoconf/types.m4
tests/semantics.at

index 56a27d60253a531a35ad134b92c31a3a00dfd733..5f3078f1ae7578370163947fea33c80c7a5ce6d2 100644 (file)
@@ -4646,7 +4646,7 @@ bytes long:
 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;
 @}
@@ -4662,6 +4662,9 @@ $ @kbd{cc -c -Ae +O2 +Onolimit conftest.c}
 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
index 8f6af6688efd8e484643bd3f369fc2d3924f3d89..d58a541fd5052f06213065f5fad0469446be8315 100644 (file)
@@ -356,7 +356,7 @@ AC_CACHE_CHECK([size of $1], AS_TR_SH([ac_cv_sizeof_$1]),
   # 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])])
index 51a0f5834123a30acb093bbb57fc899493be708a..c98ea6899594838489ce292a85053fb8d03c2e5e 100644 (file)
@@ -173,20 +173,8 @@ AC_CHECK_SIZEOF(charcharchar)
 
 # 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,,