This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, MIPS] Fix uninitialized variable in inet/getnetgrent_r.c


On Thu, 2014-12-11 at 09:38 -0800, Steve Ellcey wrote:
> On Wed, 2014-12-10 at 21:33 +0000, Joseph Myers wrote:
> > 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.
> 
> OK, Here is a new patch that puts the while loop inside the if
> statement.  That does get rid of the warning.  Other then indenting
> changes (and tweaking a comment so it doesn't wrap) that is the only
> change.
> 
> Tested on MIPS with no regressions.  OK for checkin?

OK.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]