ApM |char* |my_strerror |const int errnum
ApOM |void |new_collate |NULLOK const char* newcoll
ApOM |void |new_ctype |NN const char* newctype
+ApMn |void |_warn_problematic_locale
ApOM |void |new_numeric |NULLOK const char* newcoll
Ap |void |set_numeric_local
Ap |void |set_numeric_radix
#define _to_utf8_lower_flags(a,b,c,d) Perl__to_utf8_lower_flags(aTHX_ a,b,c,d)
#define _to_utf8_title_flags(a,b,c,d) Perl__to_utf8_title_flags(aTHX_ a,b,c,d)
#define _to_utf8_upper_flags(a,b,c,d) Perl__to_utf8_upper_flags(aTHX_ a,b,c,d)
+#define _warn_problematic_locale Perl__warn_problematic_locale
#define amagic_call(a,b,c,d) Perl_amagic_call(aTHX_ a,b,c,d)
#define amagic_deref_call(a,b) Perl_amagic_deref_call(aTHX_ a,b)
#define append_utf8_from_native_byte S_append_utf8_from_native_byte
}
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
/* This internal macro should be called from places that operate under
* locale rules. It there is a problem with the current locale that
- * hasn't been raised yet, it will output a warning this time */
+ * hasn't been raised yet, it will output a warning this time. Because
+ * this will so rarely be true, there is no point to optimize for
+ * time; instead it makes sense to minimize space used and do all the
+ * work in the rarely called function */
# define _CHECK_AND_WARN_PROBLEMATIC_LOCALE \
STMT_START { \
- 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 comp warning */ ); \
- /* GCC_DIAG_RESTORE; */ \
- SvREFCNT_dec_NN(PL_warn_locale); \
- PL_warn_locale = NULL; \
+ if (UNLIKELY(PL_warn_locale)) { \
+ _warn_problematic_locale(); \
} \
} STMT_END
#define PERL_ARGS_ASSERT__TO_UTF8_UPPER_FLAGS \
assert(p); assert(ustrp)
+PERL_CALLCONV void Perl__warn_problematic_locale(void);
PERL_CALLCONV PADOFFSET Perl_allocmy(pTHX_ const char *const name, const STRLEN len, const U32 flags)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_ALLOCMY \