This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Slience compiler warnings for NV, [IU]V compare
authorKarl Williamson <khw@cpan.org>
Sun, 22 Nov 2020 16:36:20 +0000 (09:36 -0700)
committerKarl Williamson <khw@cpan.org>
Sun, 22 Nov 2020 16:47:15 +0000 (09:47 -0700)
commitef0a8475fdfef2bfeb82df0df1e8cc211790721e
tree9134373de2a9124beead7b839d4abc5ce01aa1ff
parent333238a72a681884a924eb094c6f4d337b82b540
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
ext/POSIX/POSIX.xs
ext/POSIX/lib/POSIX.pm
inline.h
pp_ctl.c
sv.c