[Ffmpeg-devel] Possible use of uninitialized variable

Michael Niedermayer michaelni
Thu Jan 25 00:23:29 CET 2007


On Wed, Jan 24, 2007 at 09:34:09AM -0700, Loren Merritt wrote:
> On Wed, 24 Jan 2007, Panagiotis Issaris wrote:
> >GCC complains that the "line" variable defined on line 3550 snow.c
> >could be used without having been initialized.
> >
> >At first sight this appears to be the case, when start_y == 0. Line will
> >not be assigned on line 3554 but its uninitialized value will be
> >assigned to prev, which gets dereferenced in each of the possible
> >outcomes of the if's which follow (if end_y>1). Is end_y always <=1 if
> >start_y == 0?
> All uses of prev are inside if(y).
> Yes, prev might be assigned an undefined value, but it won't be used in 
> that iteration.

yes, but iam not against something like

... line=0; //silence silly "could be used without having been initialized"

it makes spotting real uninitalized variables easier (better signal to noise
ratio in gccs warnings)


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070125/420ceeea/attachment.pgp>

More information about the ffmpeg-devel mailing list