[PATCH] Fix build warnings in locale/programs/ld-ctype.c

Stefan Liebler stli@linux.ibm.com
Tue Jun 25 13:17:00 GMT 2019


Hi,

this patch fixes the gcc warnings seen with gcc 9 -march>=z13 on s390x:
programs/ld-ctype.c: In function ‘ctype_read’:
programs/ld-ctype.c:1392:13: error: ‘wch’ may be used uninitialized in 
this function [-Werror=maybe-uninitialized]
  1392 |    uint32_t wch;
       |             ^~~
programs/ld-ctype.c:1401:7: error: ‘seq’ may be used uninitialized in 
this function [-Werror=maybe-uninitialized]
  1401 |    if (seq != NULL && seq->nbytes == 1)
       |       ^
programs/ld-ctype.c:1391:20: note: ‘seq’ was declared here
  1391 |    struct charseq *seq;
       |                    ^~~

Both seq and wch are uninitialized if get_character fails.
Thus we are now returning with an error.

Bye
Stefan

ChangeLog:

	* locale/programs/ld-ctype.c (charclass_symbolic_ellipsis):
	Return error if get_character fails.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20190625_warnings_locale_programs_ld-ctype.patch
Type: text/x-patch
Size: 1691 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20190625/1eeb20d1/attachment.bin>


More information about the Libc-alpha mailing list