On Tue, 18 Mar 2014 17:07:08 -0400, Alexei Podtelezhnikov said:

>> > The patch 0004 is false positive.  The variable 'hit' is set to zero
>> > when entering the loop so 'p_last' and 'p_first' are assigned almost
>> > immediately.
>>
>> Thanks for the analysis.  However, initializing doesn't hurt, and
>> pacifying one of the most used compilers is probably a good thing.
>>
>>
>It is ugly. First we initialize to 0, then twenty lines down we reassign
>both variables to -1.

The assignment with -1 does not always happen; it depends on 2 'if' statements.

The 1st iteration of the 'do' loop at line 551 always starts with hit=0 so the 
first loop will always enter  the 'if !hit' test.  But will subsequent 
iterations of the loop always enter 'if !hit'?  If not, p_first and p_last 
might end up uninitialized.

It could well be a false positive, it's just not clear to someone like me that 
does know this code.  It's also the *only* place in freetype where is compiler 
is also sufficiently unconvinced and therefore warns.

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to