]> git.ipfire.org Git - thirdparty/glibc.git/commit
locale: prevent maybe-uninitialized errors with -Os [BZ #19444]
authorMartin Jansa <Martin.Jansa@gmail.com>
Wed, 21 Sep 2022 13:51:03 +0000 (10:51 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 5 Oct 2022 21:04:13 +0000 (18:04 -0300)
commitc651f9da530320e9939e6cbad57b87695eeba41c
tree0a0b6553c48cb4ce6e65961e0648ecea018682be
parenta878a1384c8f7ae2383c4413feab88ba2fee7f17
locale: prevent maybe-uninitialized errors with -Os [BZ #19444]

Fixes following error when building  with -Os:
| In file included from strcoll_l.c:43:
| strcoll_l.c: In function '__strcoll_l':
| ../locale/weight.h:31:26: error: 'seq2.back_us' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
|    int_fast32_t i = table[*(*cpp)++];
|                           ^~~~~~~~~
| strcoll_l.c:304:18: note: 'seq2.back_us' was declared here
|    coll_seq seq1, seq2;
|                   ^~~~
| In file included from strcoll_l.c:43:
| ../locale/weight.h:31:26: error: 'seq1.back_us' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
|    int_fast32_t i = table[*(*cpp)++];
|                           ^~~~~~~~~
| strcoll_l.c:304:12: note: 'seq1.back_us' was declared here
|    coll_seq seq1, seq2;
|             ^~~~
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
locale/weight.h