Make overflow warnings in gmtime/localtime only occur when warnings are on
Rafael Garcia-Suarez [Fri, 13 Mar 2009 12:12:33 +0000 (13:12 +0100)]
pp_sys.c

index f516e33..fa0c79a 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4466,7 +4466,7 @@ PP(pp_gmtime)
        */
        double input = 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);