This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Patch, MIPS] Fix uninitialized variable in inet/getnetgrent_r.c
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Steve Ellcey <sellcey at imgtec dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 10 Dec 2014 21:33:31 +0000
- Subject: Re: [Patch, MIPS] Fix uninitialized variable in inet/getnetgrent_r.c
- Authentication-results: sourceware.org; auth=none
- References: <9615e42e-4783-4170-8702-042df4ce8d58 at BAMAIL02 dot ba dot imgtec dot org>
On Wed, 10 Dec 2014, Steve Ellcey wrote:
> I looked at the code and I don't think we can actually use an uninitialized
> fct variable (due to the use of the no_more variable) but the compiler doesn't
> seem to be able to figure that out. This fix is to just initialize fct to
> NULL.
As previously discussed, we don't want to add such initializations to
quiet warnings.
In this case, it looks like moving the while loop inside the "if (!
no_more)" ought to make it obvious to the compiler that fct can't be used
uninitialized.
--
Joseph S. Myers
joseph@codesourcery.com