SV: [Icc-avr] Bootloader problem

Edi Im Hof edi.imhof.ml at ihe.ch
Fri Nov 2 02:39:58 PST 2007


David Brown schrieb:
> Edi Im Hof wrote:
>> Hi Silvian
>>
>> I don't know, but is it possible to force the order with brackets?
>> Like this:
>>
> 
> No, you can't force the order of execution with brackets.

OK, learned again something new, thanks.
I always thought the compiler evaluates from the inside to the outside.
Edi

   Brackets
> change the grouping for evaluation, but not the ordering.  Thus if you 
> write "a + (b + c)", then the compiler can chose to do the calculation 
> as "a + (b + c)", "(b + c) + a", "a + (c + b)" or "(b + c) + a".  All 
> you have ruled out is orders such as "(a + b) + c".  The compiler can in 
> fact be even freer in its ordering, as long as it is sure the results 
> will be the same in the end.
> 
> mvh.,
> 
> David
> 
> 
>> PageAddressHigh = (( RxChar() ) + (RxChar() ) << 8);
>>
>> You can test this, if you reorder the brackets to force a false result:
>> PageAddressHigh = ( RxChar()  + ( (RxChar() ) ) << 8);
>>
>> Edi
>>

<snip>

-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+  IH electronic                +  Phone:   ++41 52 320 90 00  +
+  Edi Im Hof                   +  Fax:     ++41 52 320 90 04  +
+  Doernlerstrasse 1, Sulz      +  URL:     http://www.ihe.ch  +
+  CH-8544 Rickenbach-Attikon   +  E-Mail:  edi.imhof at ihe.ch   +
+  Switzerland                  +                              +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



More information about the Icc-avr mailing list