summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-07-18 17:22:33 -0600
committerKarl Williamson <public@khwilliamson.com>2012-07-19 09:39:07 -0600
commit5073ffbd0df5f82154fd580e53686ef82b68748d (patch)
treeb88c0eadc7d8b413190ecec6d23809ef1495b286 /utf8.c
parent4f3e8b0f484b99e3e529e1003208d8428d68f277 (diff)
downloadperl-5073ffbd0df5f82154fd580e53686ef82b68748d.tar.gz
Only generate above-Uni warning for \p{}, \P{}
This warning was being generated inappropriately during some internal operations, such as parsing a program; spotted by Tom Christiansen. The solution is to move the check for this situation out of the common code, and into the code where just \p{} and \P{} are handled. As mentioned in the commit's perldelta, there remains a bug [perl #114148], where no warning gets generated when it should
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/utf8.c b/utf8.c
index 5797f8e010..f6c147c119 100644
--- a/utf8.c
+++ b/utf8.c
@@ -3189,24 +3189,6 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8)
Copy(ptr, PL_last_swash_key, klen, U8);
}
- if (UTF8_IS_SUPER(ptr) && ckWARN_d(WARN_NON_UNICODE)) {
- SV** const bitssvp = hv_fetchs(hv, "BITS", FALSE);
-
- /* This outputs warnings for binary properties only, assuming that
- * to_utf8_case() will output any for non-binary. Also, surrogates
- * aren't checked for, as that would warn on things like /\p{Gc=Cs}/ */
-
- if (! bitssvp || SvUV(*bitssvp) == 1) {
- /* User-defined properties can silently match above-Unicode */
- SV** const user_defined_svp = hv_fetchs(hv, "USER_DEFINED", FALSE);
- if (! user_defined_svp || ! SvUV(*user_defined_svp)) {
- const UV code_point = utf8n_to_uvuni(ptr, UTF8_MAXBYTES, 0, 0);
- Perl_warner(aTHX_ packWARN(WARN_NON_UNICODE),
- "Code point 0x%04"UVXf" is not Unicode, all \\p{} matches fail; all \\P{} matches succeed", code_point);
- }
- }
- }
-
switch ((int)((slen << 3) / needents)) {
case 1:
bit = 1 << (off & 7);