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 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


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