[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes
From: |
Sean McBride |
Subject: |
Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes |
Date: |
Tue, 18 Mar 2014 17:22:42 -0400 |
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 address@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Sean McBride, 2014/03/03
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Werner LEMBERG, 2014/03/03
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Sean McBride, 2014/03/05
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Werner LEMBERG, 2014/03/06
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Sean McBride, 2014/03/07
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Werner LEMBERG, 2014/03/09
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Sean McBride, 2014/03/14
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Alexei Podtelezhnikov, 2014/03/14
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Werner LEMBERG, 2014/03/18
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Alexei Podtelezhnikov, 2014/03/18
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes,
Sean McBride <=
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Alexei Podtelezhnikov, 2014/03/18
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Werner LEMBERG, 2014/03/19
- Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes, Werner LEMBERG, 2014/03/18