diff options
author | Karl Williamson <khw@cpan.org> | 2020-11-22 09:36:20 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-11-22 09:47:15 -0700 |
commit | ef0a8475fdfef2bfeb82df0df1e8cc211790721e (patch) | |
tree | 9134373de2a9124beead7b839d4abc5ce01aa1ff /pp_ctl.c | |
parent | 333238a72a681884a924eb094c6f4d337b82b540 (diff) | |
download | perl-ef0a8475fdfef2bfeb82df0df1e8cc211790721e.tar.gz |
Slience compiler warnings for NV, [IU]V compare
These were occurring on FreeBSD smokes.
warning: implicit conversion from 'IV' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion]
9223372036854775807 is IV_MAX. What needed to be done here was to use
the NV containing IV_MAX+1, a value that already exists in perl.h
In other instances, simply casting to an NV before doing the comparison
with the NV was what was needed.
This fixes #18328
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1228,7 +1228,7 @@ PP(pp_flop) if ((SvOK(left) && !SvIOK(left) && SvNV_nomg(left) < IV_MIN) || (SvOK(right) && (SvIOK(right) ? SvIsUV(right) && SvUV(right) > IV_MAX - : SvNV_nomg(right) > IV_MAX))) + : SvNV_nomg(right) > (NV) IV_MAX))) DIE(aTHX_ "Range iterator outside integer range"); i = SvIV_nomg(left); j = SvIV_nomg(right); |