diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-01-18 12:40:52 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-01-18 12:43:32 +0000 |
commit | ac913d5d518604c5baf7274bed76e3ff8f3e4c08 (patch) | |
tree | cd1c73fed0ce5620f2940c1e6369d0f80ba71db2 /libstdc++-v3 | |
parent | db42a0a98916340af33338c08e6a7d328121b958 (diff) | |
download | gcc-ac913d5d518604c5baf7274bed76e3ff8f3e4c08.zip gcc-ac913d5d518604c5baf7274bed76e3ff8f3e4c08.tar.gz gcc-ac913d5d518604c5baf7274bed76e3ff8f3e4c08.tar.bz2 |
libstdc++: Avoid -Wmaybe-uninitialized warnings in text_encoding.cc
These variables are only read from if we haven't reached the end of
either range, in which case they're guaranteed to be initialized to the
next alphanumeric character. But we can just initialize them to make the
compiler happy.
libstdc++-v3/ChangeLog:
* include/bits/unicode.h (__charset_alias_match): Initialize
__var_a and __var_b.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/include/bits/unicode.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h index d025d21..51bf02e 100644 --- a/libstdc++-v3/include/bits/unicode.h +++ b/libstdc++-v3/include/bits/unicode.h @@ -1084,7 +1084,7 @@ inline namespace __v15_1_0 while (true) { // Find the value of the next alphanumeric character in each string. - unsigned char __val_a, __val_b; + unsigned char __val_a{}, __val_b{}; while (__ptr_a != __end_a && (__val_a = __map(*__ptr_a, __num_a)) == 127) ++__ptr_a; |