google translate for me
Does the length of the name of my variables affect the size of the compiled code in the processor?
how can I do to reduce compiled code size ?
I have a very distant memory that to optiniser “if then else” one saves time to put in “if” the most frequent condition.
But I do not remember if it is from left to right or from right to left that the conditions are tested?
For example, in
if ( (a==b) || ( (b>c)&&(d<e) ) && ( (g==h) || ( (k<l)&&(m>n) ) ) )
if ( (a==b) || ( ) && ( ) )
** (b>c)&&(d<e) (g>=h) || ( )**
What is the order of the conditions test?
Have you link about code optimisation ?
what is faster between a<=b or a<b+1?
Variable names don’t exist in the final code that is executed.
Without seeing code, it’s difficult to say how you can optimize for size. Size of what? Flash? RAM?
The evaluation is left to right; if (a==b) || ( (b>c)&&(d<e) ) results in false, the ( (g==h) || ( (k<l)&&(m>n) ) ) will not be evaluated; similar for the OR. You can google for c if statement evaluation sequence or something in that line.
Why should we do your homework?
Expression evaluation ist from left to right.
thank you very much for your answer !
You should not edit your post after there have been replies. Rather expand the question in a second post.
For (5), have a look at the generated assembly; you can run avr-objdump -S -h yourfile.elf. On my system, the elf file is in a subdirectory of C:\Users\sterretje\AppData\Local\Temp; switch on "show verbose output during compilation" in the IDE menu file->preferences to find the exact location; the directory name will be like C:\Users\sterretje\AppData\Local\Temp\build8a912d812636e8bfb5363e32ed7d7392.tmp