summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-01-12 22:31:07 -0700
committerKarl Williamson <khw@cpan.org>2015-01-13 12:19:59 -0700
commit2726666d48c2d6d699d0a840da6e9f7a2fdfde22 (patch)
tree18606efa6f54293d89585b056977a63c44b41ab7 /locale.c
parentc0f3a893f19a236736869b0203e771705a22d986 (diff)
downloadperl-2726666d48c2d6d699d0a840da6e9f7a2fdfde22.tar.gz
Move unlikely executed macro to function
The bulk of this macro is extremely rarely executed, so it makes sense to optimize for space, as it is called from a fair number of places, and move as much as possible to a single function. For whatever it's worth, on my system with my typical compilation options, including -O0, the savings was 19640 bytes in regexec.o, 4528 in utf8.o, at a cost of 1488 in locale.o.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/locale.c b/locale.c
index e25a789a9a..e267c98746 100644
--- a/locale.c
+++ b/locale.c
@@ -414,6 +414,29 @@ Perl_new_ctype(pTHX_ const char *newctype)
}
void
+Perl__warn_problematic_locale()
+{
+ dTHX;
+
+ /* Outputs the message in PL_warn_locale, and then NULLS it */
+
+#ifdef USE_LOCALE_CTYPE
+
+ if (PL_warn_locale) {
+ /*GCC_DIAG_IGNORE(-Wformat-security); Didn't work */
+ Perl_ck_warner(aTHX_ packWARN(WARN_LOCALE),
+ SvPVX(PL_warn_locale),
+ 0 /* dummy to avoid compiler warning */ );
+ /* GCC_DIAG_RESTORE; */
+ SvREFCNT_dec_NN(PL_warn_locale);
+ PL_warn_locale = NULL;
+ }
+
+#endif
+
+}
+
+void
Perl_new_collate(pTHX_ const char *newcoll)
{
#ifdef USE_LOCALE_COLLATE