Hi,
I'm using the uVision Realview compiler and am confused about the 'break' statement inside the 'while' loop inside the 'case' statement : does it exit the while loop and executes the 'extra code' or does it exit also the 'case' statement completely without executing the 'extra code'?
use next (abstract) code:
switch ( x ) { case y: while(1){ break; } 'extra code' break; }
Thanks
Henk
If really goto, it's almost always a question of a forward goto to jump many steps out of something. Much, much better to have loop constructs to get back to an earlier position to repeat something.
No globals - something only a dimwitted person may think about. The rule is to keep down the number of symbols in each available namespace. But hardly any non-trivial program can manage with zero globals since most programs are expected to produce some side effect and you normally needs to keep track of some state to do that.
So with a little brain, the project management - or developer(s) - should have understood that they should keep down the number of auto variables in a single function, and the number of members of a struct. It's almost a question of minimizing the sum of the squares by making sure that n never gets really big anywhere in the program.
A professional developer shouldn't just follow rules, but should understand the reasons behind rules, and constantly work to change the rules until they are more advantageous.