summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-10-15 12:32:18 -0600
committerKarl Williamson <khw@cpan.org>2022-10-25 10:12:04 -0600
commit08c664df7c07619c9a7ab8039b4d42f20a3d9adf (patch)
tree305a3f6946e4e20cf608531b801ad79f5c5583c2 /locale.c
parent8f0b3fcc4329e278204a58fd52feabdf9e4c5681 (diff)
downloadperl-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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/locale.c b/locale.c
index 9d86487a9a..ef2c8cefc0 100644
--- a/locale.c
+++ b/locale.c
@@ -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));
}