On Tue, 11 Mar 2008, Robert Ammerman wrote: > > Ok so it expects a terminating ';', but what benefit does that give you. > > > > Regards > > Sergio > > Because then it is syntactically identical to a simple statement, which also > expects a trailing ';' > > Given > > if ( xxx ) > SomeMacro; > else > AnotherMacro; > > If you use '{..}' instead of 'do {..} while(0)', this expands to: > > > if ( xxx ) > { ... }; > else > { ... }; > > Which isn't going to work the way you want it to! It won't even compile > because the first ';' will terminate the if statement and there will be > nothing to which the compiler can match the 'else'. Thanks for that Bob. I will add it to my list of reasons why it is good practice to always use braces with 'if' statements :-) Regards Sergio -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist