11.07.2015 Views

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ICCV8 <strong>for</strong> AVR – C Compiler <strong>for</strong> Atmel AVRTable 2: Operator Precedence <strong>and</strong> AssociativityOperatorsAssociativity> right shift a left to right< less than greater than>= greater than or equal to== equal to!= not equal to& bitwise <strong>and</strong>^ bitwise exclusive orleft to rightleft to rightleft to rightleft to right| bitwise or left to right&& short-circuited logical <strong>and</strong>left to right|| short-circuited logical or left to right?: conditional (<strong>the</strong> only 3-oper<strong>and</strong> operator inC)= += -= *= /= %= &= ^= |= =Assignment operatorsright to leftright to left, comma operator left to righta.) St<strong>and</strong>ard C does not define whe<strong>the</strong>r a right shift is arithmetic or logical. AllImageCraft <strong>compiler</strong>s use arithmetic right shift <strong>for</strong> signed oper<strong>and</strong>s <strong>and</strong> logicalright shift <strong>for</strong> unsigned oper<strong>and</strong>s.Macro AbuseSome people use #define to define “better names” <strong>for</strong> some of <strong>the</strong> operators -- <strong>for</strong>example, EQ instead of ==, BITAND instead of &, etc. This practice is generally not agood idea, since it only serves to create a single-person dialect of <strong>the</strong> language,making <strong>the</strong> program more difficult to maintain <strong>and</strong> be read by o<strong>the</strong>r people.Operator Gotchas80

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!