On Mon, Jun 29, 2009 at 5:03 PM, Tamas Rudnai wrote: > I am not sure if it is mandatory or not but in all C compiler I have seen > the switch-case was compiled either to series of if..goto or optimised in > the similar manner, like jump tables or checking range and a goto if there > was more than one case in series describing an entire range of literals. Now that I was thinking over of it, it should be mandatory... So as once you jump into a case C should continue the execution through all case statements till a break (or the end of the switch). Therefore inside the case there should be no "if" or "goto" put by the compiler. Hence the IF ... GOTO CASE1; IF ... GOTO CASE2; IF ... GOTO CASE3; CASE1: ... .. ... CASE2: CASE3: ... ... (or the jump table or equivalent) assembly structure out of the compiler... So it should be safe to use these kind of tricks -- might not nice as per reading the source though. Tamas -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist