This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Add comment; move #if
authorKarl Williamson <khw@cpan.org>
Tue, 13 Jan 2015 19:53:34 +0000 (12:53 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 13 Jan 2015 20:53:59 +0000 (13:53 -0700)
A better comment is added.  The #if is moved so that the rare
compilation that doesn't use LC_CTYPE, no unused variable warning would
be generated.

locale.c

index e267c98..1ef1be9 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -416,12 +416,15 @@ 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
 
+    dTHX;
+
+    /* Internal-to-core function that outputs the message in PL_warn_locale,
+     * and then NULLS it.  Should be called only through the macro
+     * _CHECK_AND_WARN_PROBLEMATIC_LOCALE */
+
     if (PL_warn_locale) {
         /*GCC_DIAG_IGNORE(-Wformat-security);   Didn't work */
         Perl_ck_warner(aTHX_ packWARN(WARN_LOCALE),