EmbDev.net

Forum: ARM programming with GCC/GNU tools gcc AND operator precedence?


Author: Guest (Guest)
Posted on:

Rate this post
0 useful
not useful
Not sure where to look it up: in order to save a few cycles of precious 
processing time, I need to have the less expensive expression evaluated 
first; apparently, C does not specify an order. I thought it was from 
right to left but I'm not sure.

if(expr1 && expr2)

Author: seb (Guest)
Posted on:

Rate this post
0 useful
not useful
C does specify an order (left to right).

Author: Guest (Guest)
Posted on:

Rate this post
0 useful
not useful
Good to know, thanks.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.