X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fpragma%2Fwarn%2Fpp_hot;h=fe874ef7efff54ee2823e782fa85b23c773940ce;hb=c9166e37736ce050b2ee05d4fdf16697211280ca;hp=9a4b0a0708bfd819ffba4b427f9fe257c3ff610b;hpb=c529f79d594c53d3968d464c57ac24a21137dd09;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/pragma/warn/pp_hot b/t/pragma/warn/pp_hot index 9a4b0a0..fe874ef 100644 --- a/t/pragma/warn/pp_hot +++ b/t/pragma/warn/pp_hot @@ -9,7 +9,7 @@ Filehandle %s opened only for output [pp_print] print ; - print on closed filehandle %s [pp_print] + print() on closed filehandle %s [pp_print] close STDIN ; print STDIN "abc" ; uninitialized [pp_rv2av] @@ -30,7 +30,7 @@ glob failed (can't start child: %s) [Perl_do_readline] <; glob failed (child exited with status %d%s) [Perl_do_readline] <&STDOUT") and print ; print getc(STDERR); print getc(FOO); #################################################################### -# The next test is known to fail on some systems (Linux/BSD+glibc, # -# NeXT among others. glibc should be fixed in the next version, # -# but it appears other platforms have little hope. We skip it for # -# now (on the grounds that it is "just" a warning). # +# The next test is known to fail on some systems (Linux+old glibc, # +# old *BSDs, and NeXT, among others. # +# We skip it for now (on the grounds that it is "just" a warning). # #################################################################### #read(FOO,$_,1); no warnings 'io' ; print STDIN "anc"; EXPECT -Filehandle main::STDIN opened only for input at - line 3. -Filehandle main::STDOUT opened only for output at - line 4. -Filehandle main::STDERR opened only for output at - line 5. -Filehandle main::FOO opened only for output at - line 6. -Filehandle main::STDERR opened only for output at - line 7. -Filehandle main::FOO opened only for output at - line 8. +Filehandle STDIN opened only for input at - line 3. +Filehandle STDOUT opened only for output at - line 4. +Filehandle STDERR opened only for output at - line 5. +Filehandle FOO opened only for output at - line 6. +Filehandle STDERR opened only for output at - line 7. +Filehandle FOO opened only for output at - line 8. ######## # pp_hot.c [pp_print] use warnings 'closed' ; close STDIN ; print STDIN "anc"; +opendir STDIN, "."; +print STDIN "anc"; +closedir STDIN; no warnings 'closed' ; print STDIN "anc"; +opendir STDIN, "."; +print STDIN "anc"; EXPECT -print on closed filehandle main::STDIN at - line 4. +print() on closed filehandle STDIN at - line 4. +print() on closed filehandle STDIN at - line 6. + (Are you trying to call print() on dirhandle STDIN?) ######## # pp_hot.c [pp_rv2av] use warnings 'uninitialized' ; @@ -95,7 +101,7 @@ my @b = @$a; no warnings 'uninitialized' ; my @c = @$a; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in array dereference at - line 4. ######## # pp_hot.c [pp_rv2hv] use warnings 'uninitialized' ; @@ -104,31 +110,36 @@ my %b = %$a; no warnings 'uninitialized' ; my %c = %$a; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in hash dereference at - line 4. ######## # pp_hot.c [pp_aassign] -use warnings 'unsafe' ; +use warnings 'misc' ; my %X ; %X = (1,2,3) ; -no warnings 'unsafe' ; +no warnings 'misc' ; my %Y ; %Y = (1,2,3) ; EXPECT Odd number of elements in hash assignment at - line 3. ######## # pp_hot.c [pp_aassign] -use warnings 'unsafe' ; +use warnings 'misc' ; my %X ; %X = [1 .. 3] ; -no warnings 'unsafe' ; +no warnings 'misc' ; my %Y ; %Y = [1 .. 3] ; EXPECT Reference found where even-sized list expected at - line 3. ######## # pp_hot.c [Perl_do_readline] use warnings 'closed' ; -close STDIN ; $a = ; +close STDIN ; $a = ; +opendir STDIN, "." ; $a = ; +closedir STDIN; no warnings 'closed' ; +opendir STDIN, "." ; $a = ; $a = ; EXPECT -Read on closed filehandle main::STDIN at - line 3. +readline() on closed filehandle STDIN at - line 3. +readline() on closed filehandle STDIN at - line 4. + (Are you trying to call readline() on dirhandle STDIN?) ######## # pp_hot.c [Perl_do_readline] use warnings 'io' ; @@ -139,7 +150,7 @@ no warnings 'io' ; $a = ; unlink $file ; EXPECT -Filehandle main::FH opened only for output at - line 5. +Filehandle FH opened only for output at - line 5. ######## # pp_hot.c [Perl_sub_crush_depth] use warnings 'recursion' ; @@ -193,7 +204,7 @@ $b = sub EXPECT ######## # pp_hot.c [pp_concat] -use warnings 'misc'; +use warnings 'y2k'; use Config; BEGIN { unless ($Config{ccflags} =~ /Y2KWARN/) { @@ -207,7 +218,7 @@ $x = "19$yy\n"; $x = "19" . $yy . "\n"; $x = "319$yy\n"; $x = "319" . $yy . "\n"; -no warnings 'misc'; +no warnings 'y2k'; $x = "19$yy\n"; $x = "19" . $yy . "\n"; EXPECT