This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
change #25129 was overzealous in delaying the call to ckWARN
authorDave Mitchell <davem@fdisolutions.com>
Sun, 17 Jul 2005 19:02:10 +0000 (19:02 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Sun, 17 Jul 2005 19:02:10 +0000 (19:02 +0000)
p4raw-link: @25129 on //depot/perl: 041457d90dbb6fb79a72c7a8462f01423f2daa09

p4raw-id: //depot/perl@25159

doio.c
pp_hot.c
toke.c

diff --git a/doio.c b/doio.c
index 61a5371..e9c40a7 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -566,8 +566,9 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
        }
     }
     if (!fp) {
        }
     }
     if (!fp) {
-       if (IoTYPE(io) == IoTYPE_RDONLY && strchr(name, '\n')
-           && ckWARN(WARN_NEWLINE)
+       if (IoTYPE(io) == IoTYPE_RDONLY && ckWARN(WARN_NEWLINE)
+           && strchr(name, '\n')
+           
        )
            Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "open");
        goto say_false;
        )
            Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "open");
        goto say_false;
@@ -1394,7 +1395,7 @@ Perl_my_stat(pTHX)
        s = SvPVX_const(PL_statname);           /* s now NUL-terminated */
        PL_laststype = OP_STAT;
        PL_laststatval = PerlLIO_stat(s, &PL_statcache);
        s = SvPVX_const(PL_statname);           /* s now NUL-terminated */
        PL_laststype = OP_STAT;
        PL_laststatval = PerlLIO_stat(s, &PL_statcache);
-       if (PL_laststatval < 0 && strchr(s, '\n') && ckWARN(WARN_NEWLINE))
+       if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(s, '\n'))
            Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "stat");
        return PL_laststatval;
     }
            Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "stat");
        return PL_laststatval;
     }
index 35558f1..1e3d5ea 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1611,8 +1611,8 @@ Perl_do_readline(pTHX)
             const STRLEN len = SvCUR(sv) - offset;
             const U8 *f;
             
             const STRLEN len = SvCUR(sv) - offset;
             const U8 *f;
             
-            if (!Perl_is_utf8_string_loc(aTHX_ s, len, &f)
-               && ckWARN(WARN_UTF8))
+            if (ckWARN(WARN_UTF8) &&
+                   !Perl_is_utf8_string_loc(aTHX_ s, len, &f))
                  /* Emulate :encoding(utf8) warning in the same case. */
                  Perl_warner(aTHX_ packWARN(WARN_UTF8),
                              "utf8 \"\\x%02X\" does not map to Unicode",
                  /* Emulate :encoding(utf8) warning in the same case. */
                  Perl_warner(aTHX_ packWARN(WARN_UTF8),
                              "utf8 \"\\x%02X\" does not map to Unicode",
diff --git a/toke.c b/toke.c
index ae56a6f..19bac4f 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3515,7 +3515,7 @@ Perl_yylex(pTHX)
            OPERATOR(',');
        if (tmp == '~')
            PMop(OP_MATCH);
            OPERATOR(',');
        if (tmp == '~')
            PMop(OP_MATCH);
-       if (tmp && isSPACE(*s) && strchr("+-*/%.^&|<",tmp) && ckWARN(WARN_SYNTAX))
+       if (tmp && isSPACE(*s) && ckWARN(WARN_SYNTAX) && strchr("+-*/%.^&|<",tmp))
            Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Reversed %c= operator",(int)tmp);
        s--;
        if (PL_expect == XSTATE && isALPHA(tmp) &&
            Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Reversed %c= operator",(int)tmp);
        s--;
        if (PL_expect == XSTATE && isALPHA(tmp) &&
@@ -3685,8 +3685,8 @@ Perl_yylex(pTHX)
            else if (*s == '{') {
                char *t;
                PL_tokenbuf[0] = '%';
            else if (*s == '{') {
                char *t;
                PL_tokenbuf[0] = '%';
-               if (strEQ(PL_tokenbuf+1, "SIG") && (t = strchr(s, '}'))
-                   && (t = strchr(t, '=')) && ckWARN(WARN_SYNTAX))
+               if (strEQ(PL_tokenbuf+1, "SIG")  && ckWARN(WARN_SYNTAX)
+                   && (t = strchr(s, '}')) && (t = strchr(t, '=')))
                {
                    char tmpbuf[sizeof PL_tokenbuf];
                    for (t++; isSPACE(*t); t++) ;
                {
                    char tmpbuf[sizeof PL_tokenbuf];
                    for (t++; isSPACE(*t); t++) ;