Disable shorten-64-to-32 warning on IL32LLP64

Disable the shorten-64-to-32 warning for now, because it currently
generates a lot of warnings on platforms where `sizeof(void*)` is
larger than `sizeof(long)`.

TODO: Replace `long` with `ptrdiff_t` or something in the all sources.
This commit is contained in:
Nobuyoshi Nakada 2025-10-16 21:49:44 +09:00
parent 485f079dc5
commit 87593f2c0f
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2025-10-17 06:35:16 +00:00

View File

@ -4304,6 +4304,24 @@ AS_IF([test "${ARCH_FLAG}"], [
CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
])
AS_CASE([" $rb_cv_warnflags "], [*" -Wshorten-64-to-32 "*|*" -Werror=shorten-64-to-32 "*], [
voidp_ll=
AS_CASE([$ac_cv_sizeof_voidp],
[SIZEOF_LONG_LONG], [voidp_ll=true],
[@<:@0-9@:>@*], [
AS_IF([test $ac_cv_sizeof_voidp -gt $ac_cv_sizeof_long], [voidp_ll=true])
])
AS_IF([test "$voidp_ll"], [
# Disable the shorten-64-to-32 warning for now, because it currently
# generates a lot of warnings on platforms where `sizeof(void*)` is
# larger than `sizeof(long)`.
#
# TODO: Replace `long` with `ptrdiff_t` or something in the all sources.
rb_cv_warnflags=`echo "$rb_cv_warnflags" |
sed -e 's/ -W\(shorten-64-to-32 \)/ -Wno-\1/' \
-e 's/ -Werror=\(shorten-64-to-32 \)/ -Wno-\1/'`
])
])
rb_cv_warnflags=`echo "$rb_cv_warnflags" | sed 's/^ *//;s/ *$//'`
warnflags="$rb_cv_warnflags"
AC_SUBST(cppflags)dnl