> So
>    if (a = a + 1024)
> 
> evaluates a + 1024, then assigns the result to a, then tests the result
> (of the new a) for true or false ... (or zero or non zero) so it'll always
> be true...
In the interest of nitpicking: if a has value of 64512 then this evaluates
to 0 ie false. Seeing that 'a' starts with initial value of 0 this will
evaluate to zero every 64th iteration (2**16/1024, assuming unsigned int is
16 bits) of the loop. Probably not what was intended...but this does not
always evaluate to true and this sort of statement might make sense in
some circumstances.

 br Kusti
 


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to