On Fri, 8 Jun 2001, Andrew James Richardson wrote:
>> The original says "if a and b then c", while yours says:
>>
>> "if a and b then c"
>>
>> Your multiple if block is syntactically equivalent to
>>
>> if ( !image && !image->Data)
>>
>> Notice the flipping of || to && from the original example.
>
>Your right :)
>
>Ok we can all re-write it to work proper, but as one is assured
>that associativity is strict left2right then were all OK, maybe
>Im thinking if the , operator (but youll problably say that
>that is strict left2right too!!).
Yep, it is. ;o) There is a sequence point immediately after the
evaluation of the left hand expression. This guarantees left to
right associativity.
foo++, bar;
foo++ will always occur first, then after the sequence point bar
will occur.
Most operator precedence quick reference charts also have
associativity rules on them like:
&& L-R
|| L-R
etc.
A quickref like this is invaluable for makeing sure your code
does what you expect. Then you just have to beware the side
effects of pre/post inc/dec. ;o)
----------------------------------------------------------------------
Mike A. Harris Shipping/mailing address:
OS Systems Engineer 190 Pittsburgh Ave., Sault Ste. Marie,
Red Hat Inc. Ontario, Canada, P6C 5B3
http://www.redhat.com Phone: (705)949-2136
----------------------------------------------------------------------
Latest XFree86 test RPMS: ftp://people.redhat.com/mharris/testing
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dri-devel