develooper Front page | perl.perl5.porters | Postings from August 2001

[PATCH perl@11660] Warning incorrectly reported without -w

From:
Rafael Garcia-Suarez
Date:
August 14, 2001 12:21
Subject:
[PATCH perl@11660] Warning incorrectly reported without -w
Message ID:
20010814212327.A1919@rafael
This one-liner (with perl@11660)
    perl -le 'print v256'
produces something like :
    Wide character in print at -e line 1.
    Ä

But the message is documented as a warning in perldiag.
This patch corrects the problem:

--- doio.c.orig	Tue Aug 14 21:11:40 2001
+++ doio.c	Tue Aug 14 21:16:59 2001
@@ -1222,7 +1222,9 @@
 		sv_utf8_upgrade(sv = sv_mortalcopy(sv));
 	}
 	else if (DO_UTF8(sv)) {
-	    if (!sv_utf8_downgrade((sv = sv_mortalcopy(sv)), TRUE)) {
+	    if (!sv_utf8_downgrade((sv = sv_mortalcopy(sv)), TRUE)
+		&& ckWARN(WARN_UTF8))
+	    {
 		Perl_warner(aTHX_ WARN_UTF8, "Wide character in print");
 	    }
 	}



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About