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 /inline.h | |
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 'inline.h')
-rw-r--r-- | inline.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1980,7 +1980,7 @@ S_lossless_NV_to_IV(const NV nv, IV *ivp) /* Written this way so that with an always-false NaN comparison we * return false */ - if (!(LIKELY(nv >= IV_MIN) && LIKELY(nv <= IV_MAX))) { + if (!(LIKELY(nv >= (NV) IV_MIN) && LIKELY(nv < IV_MAX_P1))) { return FALSE; } |