not finding it. Chances are you left some needed parentheses out
earlier in the line, and you really meant a "less than".
+=item gmtime(%f) failed
+
+(W overflow) You called C<gmtime> with a number that it could not handle:
+too large, too small, or NaN. The returned value is C<undef>.
+
=item gmtime(%f) too large
(W overflow) You called C<gmtime> with a number that was larger than
form of C<open> does not support pipes, such as C<open($pipe, '|-', @args)>.
Use the two-argument C<open($pipe, '|prog arg1 arg2...')> form instead.
+=item localtime(%f) failed
+
+(W overflow) You called C<localtime> with a number that it could not handle:
+too large, too small, or NaN. The returned value is C<undef>.
+
=item localtime(%f) too large
(W overflow) You called C<localtime> with a number that was larger
}
if (err == NULL) {
+ /* diag_listed_as: gmtime(%f) failed */
/* XXX %lld broken for quads */
Perl_ck_warner(aTHX_ packWARN(WARN_OVERFLOW),
"%s(%.0" NVff ") failed", opname, when);
}
if (GIMME != G_ARRAY) { /* scalar context */
- SV *tsv;
- /* XXX newSVpvf()'s %lld type is broken, so cheat with a double */
- double year = (double)tmbuf.tm_year + 1900;
-
EXTEND(SP, 1);
EXTEND_MORTAL(1);
if (err == NULL)
RETPUSHUNDEF;
-
- tsv = Perl_newSVpvf(aTHX_ "%s %s %2d %02d:%02d:%02d %.0f",
- dayname[tmbuf.tm_wday],
- monname[tmbuf.tm_mon],
- tmbuf.tm_mday,
- tmbuf.tm_hour,
- tmbuf.tm_min,
- tmbuf.tm_sec,
- year);
- mPUSHs(tsv);
+ else {
+ mPUSHs(Perl_newSVpvf(aTHX_ "%s %s %2d %02d:%02d:%02d %.0f",
+ dayname[tmbuf.tm_wday],
+ monname[tmbuf.tm_mon],
+ tmbuf.tm_mday,
+ tmbuf.tm_hour,
+ tmbuf.tm_min,
+ tmbuf.tm_sec,
+ /* XXX newSVpvf()'s %lld type is broken,
+ * so cheat with a double */
+ (double)tmbuf.tm_year + 1900));
+ }
}
else { /* list context */
if ( err == NULL )
require './test.pl';
}
-plan tests => 66;
+plan tests => 70;
# These tests make sure, among other things, that we don't end up
# burning tons of CPU for dates far in the future.
|| $small_time == $smallest
|| $big_time - 200 != $biggest
|| $big_time == $biggest) {
- skip "Can't represent test values", 4;
+ skip "Can't represent test values", 8;
}
my $small_time_f = sprintf("%.0f", $small_time);
my $big_time_f = sprintf("%.0f", $big_time);
$warning = '';
my $date = gmtime($big_time);
like $warning, qr/^gmtime\($big_time_f\) too large/;
+ like $warning, qr/^gmtime\($big_time_f\) failed/m;
$warning = '';
$date = localtime($big_time);
like $warning, qr/^localtime\($big_time_f\) too large/;
+ like $warning, qr/^localtime\($big_time_f\) failed/m;
$warning = '';
$date = gmtime($small_time);
like $warning, qr/^gmtime\($small_time_f\) too small/;
+ like $warning, qr/^gmtime\($small_time_f\) failed/m;
$warning = '';
$date = localtime($small_time);
like $warning, qr/^localtime\($small_time_f\) too small/;
-
+ like $warning, qr/^localtime\($small_time_f\) failed/m;
}