summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-11-22 09:36:20 -0700
committerKarl Williamson <khw@cpan.org>2020-11-22 09:47:15 -0700
commitef0a8475fdfef2bfeb82df0df1e8cc211790721e (patch)
tree9134373de2a9124beead7b839d4abc5ce01aa1ff /pp_ctl.c
parent333238a72a681884a924eb094c6f4d337b82b540 (diff)
downloadperl-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 5cb5a10b20..ed451c02e8 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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);