Skip to content

Commit

Permalink
locale.c: Silence some compiler warnings if no LC_ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Aug 10, 2022
1 parent 616697b commit 9b5b2b6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions locale.c
Expand Up @@ -1356,6 +1356,11 @@ S_stdize_locale(pTHX_ const int category,
return retval;
}

# else /* else no LC_ALL */

PERL_UNUSED_ARG(category);
PERL_UNUSED_ARG(caller_line);

# endif

/* Here, there was a problem in an individual category. This means that at
Expand Down Expand Up @@ -3552,9 +3557,6 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
*bad_lang_use_once
&& strNE("0", bad_lang_use_once)))));

/* setlocale() return vals; not copied so must be looked at immediately */
const char * sl_result[NOMINAL_LC_ALL_INDEX + 1];

/* current locale for given category; should have been copied so aren't
* volatile */
const char * curlocales[NOMINAL_LC_ALL_INDEX + 1];
Expand Down Expand Up @@ -3788,6 +3790,9 @@ Perl_init_i18nl10n(pTHX_ int printwarn)

# ifdef LC_ALL

/* setlocale() return vals; not copied so must be looked at
* immediately. */
const char * sl_result[NOMINAL_LC_ALL_INDEX + 1];
sl_result[LC_ALL_INDEX_] = stdized_setlocale(LC_ALL, trial_locale);
DEBUG_LOCALE_INIT(LC_ALL_INDEX_, trial_locale, sl_result[LC_ALL_INDEX_]);
if (! sl_result[LC_ALL_INDEX_]) {
Expand Down

0 comments on commit 9b5b2b6

Please sign in to comment.