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

Joseph Myers joseph@codesourcery.com
Wed Dec 10 21:33:00 GMT 2014


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



More information about the Libc-alpha mailing list