This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Make global a warning msg text
authorKarl Williamson <khw@cpan.org>
Wed, 15 Jan 2020 12:13:20 +0000 (05:13 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 23 Jan 2020 22:46:55 +0000 (15:46 -0700)
This is in preparation for it to be raised in other files

globvar.sym
perl.h
utf8.c

index dcc65f2..0462026 100644 (file)
@@ -95,3 +95,4 @@ PL_warn_uninit
 PL_WARN_ALL
 PL_WARN_NONE
 PL_watch_pvx
+PL_extended_cp_format
diff --git a/perl.h b/perl.h
index c374da7..c75dded 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -4642,7 +4642,9 @@ EXTCONST char PL_no_localize_ref[]
   INIT("Can't localize through a reference");
 EXTCONST char PL_memory_wrap[]
   INIT("panic: memory wrap");
-
+EXTCONST char PL_extended_cp_format[]
+  INIT("Code point 0x%" UVXf " is not Unicode, requires a Perl extension,"
+                             " and so is not portable");
 EXTCONST char PL_Yes[]
   INIT("1");
 EXTCONST char PL_No[]
diff --git a/utf8.c b/utf8.c
index d426635..7b82985 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -171,9 +171,6 @@ const char nonchar_cp_format[]   = "Unicode non-character U+%04" UVXf
                                    " is not recommended for open interchange";
 const char super_cp_format[]     = "Code point 0x%" UVXf " is not Unicode,"
                                    " may not be portable";
-const char perl_extended_cp_format[] = "Code point 0x%" UVXf " is not"        \
-                                       " Unicode, requires a Perl extension," \
-                                       " and so is not portable";
 
 #define HANDLE_UNICODE_SURROGATE(uv, flags, msgs)                   \
     STMT_START {                                                    \
@@ -339,7 +336,7 @@ Perl_uvoffuni_to_utf8_flags_msgs(pTHX_ U8 *d, UV uv, const UV flags, HV** msgs)
 
             /* Choose the more dire applicable warning */
             if (UNICODE_IS_PERL_EXTENDED(uv)) {
-                format = perl_extended_cp_format;
+                format = PL_extended_cp_format;
                 category = packWARN2(WARN_NON_UNICODE, WARN_PORTABLE);
                 if (flags & (UNICODE_WARN_PERL_EXTENDED
                             |UNICODE_DISALLOW_PERL_EXTENDED))
@@ -2107,7 +2104,7 @@ Perl__utf8n_to_uvchr_msgs_helper(const U8 *s,
                          * */
                         if (UNICODE_IS_PERL_EXTENDED(uv)) {
                             message = Perl_form(aTHX_
-                                            perl_extended_cp_format, uv);
+                                            PL_extended_cp_format, uv);
                         }
                         else {
                             message = Perl_form(aTHX_