[Fribidi-discuss] (Justified?) compilation warning

Behdad Esfahbod behdad at bamdad.org
Sat Sep 14 01:30:05 EST 2002


On Fri, 13 Sep 2002, Shachar Shemesh wrote:

> When trying to compile fribidi, I get warning on line 1270 of fribidi.c. 
> It seems that the compiler cannot determine for sure that "seq_end" is 
> not used before it is initialized, and issues a warning.
>
> Brief analysis shows that, since is_nsm_seq is initialized to zero, and 
> since seq_end is used within an "if" caluse that checks whether 
> "is_nsm_seq" is true, and since the "else" clause of the "if" 
> initializes "seq_end", that this warning is unfounded. I would, however, 
> like someone with better understanding of the coded to comment on this.

Ok, fixed it.  The conditions force that seq_end is always 
initialized before use, but the compiler cannot understand it.
 
> I would also like to point out that seq_end is initialized to an 
> integer, and is used as an integer, despite having been defined as 
> "fribidi_boolean". This seems to me to be a semantic problem, if not a 
> syntactic one.

It should be of FriBidiStrIndex type.  fixed.

>                 Shachar

Well, I must confess that it was a real bug report.  Thank you 
Shachar.

-- 
Behdad Esfahbod		23 Shahrivar 1381, 2002 Sep 14 
http://behdad.org/	[Finger for Geek Code]

#define is_persian_leap(y) ((((y)-474)%2820+2820)%2820*31%128<31)







More information about the FriBidi mailing list