]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Remove incorrect check in AC_CHECK_SIZEOF
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 7 Feb 2024 20:42:04 +0000 (12:42 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 7 Feb 2024 20:43:11 +0000 (12:43 -0800)
* lib/autoconf/types.m4 (AC_CHECK_SIZEOF, AC_CHECK_ALIGNOF):
When the size or alignment cannot be determined, do not fail if
ac_cv_type_$1 is yes, as there’s no guarantee that ac_cv_type_$1
is defined, and failure here would contradict the documentation
that the size or alignment is 0 when sizeof($1)/alignof($1) cannot
be compiled.  The test for ac_cv_type_$1 made sense long ago when
it was checked for in these macros, but the test has not made
sense for many years.

lib/autoconf/types.m4

index 8ed2f1555d73ca15b0b4df9027a21bf22459883a..f231fcfcd9b06fa9f995aede601015224d4ad163 100644 (file)
@@ -837,11 +837,7 @@ AC_DEFUN([AC_CHECK_SIZEOF],
 _AC_CACHE_CHECK_INT([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])],
   [(long int) (sizeof ($1))],
   [AC_INCLUDES_DEFAULT([$3])],
-  [if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
-     AC_MSG_FAILURE([cannot compute sizeof ($1)], 77)
-   else
-     AS_TR_SH([ac_cv_sizeof_$1])=0
-   fi])
+  [AS_TR_SH([ac_cv_sizeof_$1])=0])
 
 AC_DEFINE_UNQUOTED(AS_TR_CPP(sizeof_$1), $AS_TR_SH([ac_cv_sizeof_$1]),
                   [The size of '$1', as computed by sizeof.])
@@ -866,11 +862,7 @@ _AC_CACHE_CHECK_INT([alignment of $1], [AS_TR_SH([ac_cv_alignof_$3])],
   [(long int) offsetof (ac__type_alignof_, y)],
   [AC_INCLUDES_DEFAULT([$2])
 typedef struct { char x; $1 y; } ac__type_alignof_;],
-  [if test "$AS_TR_SH([ac_cv_type_$3])" = yes; then
-     AC_MSG_FAILURE([cannot compute alignment of $1], 77)
-   else
-     AS_TR_SH([ac_cv_alignof_$3])=0
-   fi])
+  [AS_TR_SH([ac_cv_alignof_$3])=0])
 
 AC_DEFINE_UNQUOTED(AS_TR_CPP(alignof_$3), $AS_TR_SH([ac_cv_alignof_$3]),
                   [The normal alignment of '$1', in bytes.])