mirror of
https://https.git.savannah.gnu.org/git/autoconf.git
synced 2026-01-26 15:03:22 +00:00
Remove incorrect check in AC_CHECK_SIZEOF
* 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.
This commit is contained in:
parent
163dade069
commit
51dec81849
@ -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.])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user