This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
warn is a macro, avoid using at a variable to avoid warnings
authorGurusamy Sarathy <gsar@cpan.org>
Thu, 10 Aug 2000 08:38:39 +0000 (08:38 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 10 Aug 2000 08:38:39 +0000 (08:38 +0000)
in some configurations; readdir.t is too conservative in
estimating number of *.t's

p4raw-id: //depot/perl@6562

t/op/readdir.t
util.c

index d101c2f..9da560c 100755 (executable)
@@ -20,7 +20,7 @@ if (opendir(OP, "op")) { print "ok 1\n"; } else { print "not ok 1\n"; }
 @D = grep(/^[^\.].*\.t$/i, readdir(OP));
 closedir(OP);
 
-if (@D > 20 && @D < 100) { print "ok 2\n"; } else { print "not ok 2\n"; }
+if (@D > 20 && @D < 150) { print "ok 2\n"; } else { print "not ok 2\n"; }
 
 @R = sort @D;
 @G = sort <op/*.t>;
diff --git a/util.c b/util.c
index 3374c0c..28a0025 100644 (file)
--- a/util.c
+++ b/util.c
@@ -3891,7 +3891,7 @@ void
 Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op)
 {
     char *vile;
-    I32   warn;
+    I32   warn_type;
     char *func =
        op == OP_READLINE   ? "readline"  :     /* "<HANDLE>" not nice */
        op == OP_LEAVEWRITE ? "write" :         /* "write exit" not nice */
@@ -3903,11 +3903,11 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op)
 
     if (io && IoTYPE(io) == IoTYPE_CLOSED) {
        vile = "closed";
-       warn = WARN_CLOSED;
+       warn_type = WARN_CLOSED;
     }
     else {
        vile = "unopened";
-       warn = WARN_UNOPENED;
+       warn_type = WARN_UNOPENED;
     }
 
     if (gv && isGV(gv)) {
@@ -3917,18 +3917,18 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op)
     }
 
     if (name && *name) {
-       Perl_warner(aTHX_ warn,
+       Perl_warner(aTHX_ warn_type,
                    "%s%s on %s %s %s", func, pars, vile, type, name);
        if (io && IoDIRP(io) && !(IoFLAGS(io) & IOf_FAKE_DIRP))
-           Perl_warner(aTHX_ warn,
+           Perl_warner(aTHX_ warn_type,
                        "\t(Are you trying to call %s%s on dirhandle %s?)\n",
                        func, pars, name);
     }
     else {
-       Perl_warner(aTHX_ warn,
+       Perl_warner(aTHX_ warn_type,
                    "%s%s on %s %s", func, pars, vile, type);
        if (io && IoDIRP(io) && !(IoFLAGS(io) & IOf_FAKE_DIRP))
-           Perl_warner(aTHX_ warn,
+           Perl_warner(aTHX_ warn_type,
                        "\t(Are you trying to call %s%s on dirhandle?)\n",
                        func, pars);
     }