This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: gcc 4.7 build failures from -Werror
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Wed, 20 Jan 2016 16:30:29 -0200
- Subject: Re: gcc 4.7 build failures from -Werror
- Authentication-results: sourceware.org; auth=none
- References: <569FC5ED dot 9040004 at ezchip dot com>
On 20-01-2016 15:37, Chris Metcalf wrote:
> I first tried to do a build of glibc for tilepro with an old gcc 4.7.3 compiler
> that I had prebuilt and lying around. However, this is no longer able to
> build glibc; it generates maybe-uninitialized warnings in stdio-common/vfwscanf.c
> and nis/nis_table.c. I tried 4.8.5 and it worked fine. I'm not sure if this is an
> argument to upgrade to 4.8 as a minimum, or if we should spend any effort
> trying to fix the issues with gcc 4.7.
>
> In file included from vfwscanf.c:2:0:
> vfscanf.c: In function â_IO_vfwscanfâ:
> vfscanf.c:1543:21: error: âwcdigits_extended[9]â may be used uninitialized in this function [-Werror=maybe-uninitialized]
> vfscanf.c:1543:21: error: âwcdigits_extended[8]â may be used uninitialized in this function [-Werror=maybe-uninitialized]
> vfscanf.c:1543:21: error: âwcdigits_extended[7]â may be used uninitialized in this function [-Werror=maybe-uninitialized]
> vfscanf.c:1543:21: error: âwcdigits_extended[6]â may be used uninitialized in this function [-Werror=maybe-uninitialized]
> vfscanf.c:1543:21: error: âwcdigits_extended[5]â may be used uninitialized in this function [-Werror=maybe-uninitialized]
> vfscanf.c:1543:21: error: âwcdigits_extended[4]â may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
Seems a false positive imho, 'wcdigits_extended' is set at stdio-common/vfscanf.c:1486
iff '__glibc_unlikely (map != NULL)) and later used at line 1523 with same constraints.
I think now best approach would be add a DIAG_IGNORE_NEEDS_COMMENT for 4.7 and revise
it later when we move forward to 4.8.
> nis_table.c: In function ânis_listâ:
> nis_table.c:178:6: error: âtableptrâ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> nis_table.c:214:9: note: âtableptrâ was declared here
>
This is another false positive: since '__follow_path' is called with same tablepath
and tableptr define at 214-215, first call to '__follow_path' to defined value. I think
again this should be suppressed by DIAG_IGNORE_NEEDS_COMMENT.