From 51dec81849467973b1ef6d3fc8318b5b4f34b1c4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 7 Feb 2024 12:42:04 -0800 Subject: [PATCH] Remove incorrect check in AC_CHECK_SIZEOF MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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 | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4 index 8ed2f1555..f231fcfcd 100644 --- a/lib/autoconf/types.m4 +++ b/lib/autoconf/types.m4 @@ -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.]) -- 2.47.3