In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/7a67abdf144958503a96be280e967853af1af745?hp=3a7a94e274d5af79b9dacbe2adc9c4cabcf24a08>
- Log ----------------------------------------------------------------- commit 7a67abdf144958503a96be280e967853af1af745 Author: Rafael Garcia-Suarez <[email protected]> Date: Fri Mar 13 13:15:16 2009 +0100 Ignore the decimal part of any floating point argument passed to localtime or gmtime That way the overload warning won't be emitted for non-overflowing floating point values. M pp_sys.c commit 05fe29fd3bc243a33acdc8a62bc4ce42df75ca4b Author: Rafael Garcia-Suarez <[email protected]> Date: Fri Mar 13 13:12:33 2009 +0100 Make overflow warnings in gmtime/localtime only occur when warnings are on M pp_sys.c ----------------------------------------------------------------------- Summary of changes: pp_sys.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pp_sys.c b/pp_sys.c index f516e33..b42cced 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4464,9 +4464,9 @@ PP(pp_gmtime) using a double causes an unfortunate loss of accuracy on high numbers. What we really need is an SvQV. */ - double input = POPn; + double input = Perl_floor(POPn); when = (Time64_T)input; - if( when != input ) { + if (when != input && ckWARN(WARN_OVERFLOW)) { Perl_warner(aTHX_ packWARN(WARN_OVERFLOW), "%s(%.0f) too large", opname, input); } @@ -4478,7 +4478,7 @@ PP(pp_gmtime) err = gmtime64_r(&when, &tmbuf); #endif - if( err == NULL ) { + if (err == NULL && ckWARN(WARN_OVERFLOW)) { /* XXX %lld broken for quads */ Perl_warner(aTHX_ packWARN(WARN_OVERFLOW), "%s(%.0f) failed", opname, (double)when); -- Perl5 Master Repository
