diff options
author | Karl Williamson <khw@cpan.org> | 2022-10-15 12:32:18 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-10-25 10:12:04 -0600 |
commit | 08c664df7c07619c9a7ab8039b4d42f20a3d9adf (patch) | |
tree | 305a3f6946e4e20cf608531b801ad79f5c5583c2 /locale.c | |
parent | 8f0b3fcc4329e278204a58fd52feabdf9e4c5681 (diff) | |
download | perl-08c664df7c07619c9a7ab8039b4d42f20a3d9adf.tar.gz |
locale.c: Silence '-Wchar-subscripts' C++ warning
In, for example,
nntp.perl.org/group/perl.daily-build.reports/2022/10/msg285932.html
we get:
locale.c:2281:27: warning: array subscript is of type 'char'
[-Wchar-subscripts]
locale.c:2282:27: warning: array subscript is of type 'char'
[-Wchar-subscripts]
These warnings are bogus, but better to avoid them.
Diffstat (limited to 'locale.c')
-rw-r--r-- | locale.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2340,8 +2340,13 @@ S_new_ctype(pTHX_ const char *newctype) if (bad_count == 2 && maybe_utf8_turkic) { bad_count = 0; *bad_chars_list = '\0'; - PL_fold_locale['I'] = 'I'; - PL_fold_locale['i'] = 'i'; + + /* The casts are because otherwise some compilers warn: + gcc.gnu.org/bugzilla/show_bug.cgi?id=99950 + gcc.gnu.org/bugzilla/show_bug.cgi?id=94182 + */ + PL_fold_locale[ (U8) 'I' ] = 'I'; + PL_fold_locale[ (U8) 'i' ] = 'i'; PL_in_utf8_turkic_locale = TRUE; DEBUG_L(PerlIO_printf(Perl_debug_log, "%s is turkic\n", newctype)); } |