summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-03-05 10:34:05 -0700
committerKarl Williamson <public@khwilliamson.com>2012-03-05 10:42:06 -0700
commitac75b4855a68341286ec0a33dea1d0908bd367fe (patch)
treecdc9b30758fe510c8b3ecabce9b222e98b3f9e5e
parentc24a8ba364a751cb1cd5d4f9135fa3d621a5dbdd (diff)
downloadperl-smoke-me/khw-regex.tar.gz
PATCH: [perl #111338] Warnings in utf8 subcategories do nothing in isolationsmoke-me/khw-regex
This was the result of assuming that these would not be on unless the main category was also on.
-rw-r--r--doio.c2
-rw-r--r--t/lib/warnings/utf83
-rw-r--r--utf8.c2
3 files changed, 2 insertions, 5 deletions
diff --git a/doio.c b/doio.c
index 5d54a9b5d7..0da05c127c 100644
--- a/doio.c
+++ b/doio.c
@@ -1225,7 +1225,7 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp)
tmpbuf = bytes_to_utf8((const U8*) tmps, &len);
tmps = (char *) tmpbuf;
}
- else if (ckWARN_d(WARN_UTF8)) {
+ else if (ckWARN4_d(WARN_UTF8, WARN_SURROGATE, WARN_NON_UNICODE, WARN_NONCHAR)) {
(void) check_utf8_print((const U8*) tmps, len);
}
}
diff --git a/t/lib/warnings/utf8 b/t/lib/warnings/utf8
index 7d3886c388..44e3c4e4fa 100644
--- a/t/lib/warnings/utf8
+++ b/t/lib/warnings/utf8
@@ -349,7 +349,6 @@ EXPECT
Unicode surrogate U+D800 is illegal in UTF-8 at - line 6.
Unicode non-character U+FFFF is illegal for open interchange at - line 7.
########
-# TODO
# NAME C<use warnings "nonchar"> works in isolation
require "../test.pl";
use warnings 'nonchar';
@@ -360,7 +359,6 @@ close $fh;
EXPECT
Unicode non-character U+FFFF is illegal for open interchange at - line 5.
########
-# TODO
# NAME C<use warnings "surrogate"> works in isolation
require "../test.pl";
use warnings 'surrogate';
@@ -371,7 +369,6 @@ close $fh;
EXPECT
Unicode surrogate U+D800 is illegal in UTF-8 at - line 5.
########
-# TODO
# NAME C<use warnings "non_unicode"> works in isolation
require "../test.pl";
use warnings 'non_unicode';
diff --git a/utf8.c b/utf8.c
index 2b1e99b23a..e8fc12f1e4 100644
--- a/utf8.c
+++ b/utf8.c
@@ -136,7 +136,7 @@ Perl_uvuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags)
{
PERL_ARGS_ASSERT_UVUNI_TO_UTF8_FLAGS;
- if (ckWARN_d(WARN_UTF8)) {
+ if (ckWARN4_d(WARN_UTF8, WARN_SURROGATE, WARN_NON_UNICODE, WARN_NONCHAR)) {
if (UNICODE_IS_SURROGATE(uv)) {
if (flags & UNICODE_WARN_SURROGATE) {
Perl_ck_warner_d(aTHX_ packWARN(WARN_SURROGATE),