Skip to content

Commit 87593f2

Browse files
committed
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.
1 parent 485f079 commit 87593f2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

configure.ac

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4304,6 +4304,24 @@ AS_IF([test "${ARCH_FLAG}"], [
43044304
CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
43054305
LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
43064306
])
4307+
AS_CASE([" $rb_cv_warnflags "], [*" -Wshorten-64-to-32 "*|*" -Werror=shorten-64-to-32 "*], [
4308+
voidp_ll=
4309+
AS_CASE([$ac_cv_sizeof_voidp],
4310+
[SIZEOF_LONG_LONG], [voidp_ll=true],
4311+
[@<:@0-9@:>@*], [
4312+
AS_IF([test $ac_cv_sizeof_voidp -gt $ac_cv_sizeof_long], [voidp_ll=true])
4313+
])
4314+
AS_IF([test "$voidp_ll"], [
4315+
# Disable the shorten-64-to-32 warning for now, because it currently
4316+
# generates a lot of warnings on platforms where `sizeof(void*)` is
4317+
# larger than `sizeof(long)`.
4318+
#
4319+
# TODO: Replace `long` with `ptrdiff_t` or something in the all sources.
4320+
rb_cv_warnflags=`echo "$rb_cv_warnflags" |
4321+
sed -e 's/ -W\(shorten-64-to-32 \)/ -Wno-\1/' \
4322+
-e 's/ -Werror=\(shorten-64-to-32 \)/ -Wno-\1/'`
4323+
])
4324+
])
43074325
rb_cv_warnflags=`echo "$rb_cv_warnflags" | sed 's/^ *//;s/ *$//'`
43084326
warnflags="$rb_cv_warnflags"
43094327
AC_SUBST(cppflags)dnl

0 commit comments

Comments
 (0)