28-05-2013, 06:24 AM
While I fully understand the need to weld multiple statements in a function-like macro into a compound statement using the do-while(0) construct, I wonder why rule 19.4 explicitely includes macros with only one statement.
I've searched the net high and low and could not find any reason for requiring single statements to be encapsulated in do-while(0). Could you give an example here of code that breaks when disregarding this rule?
Quote: The do-while-zero construct is used to wrap a series of one or more statements and ensure correct behaviour.
I've searched the net high and low and could not find any reason for requiring single statements to be encapsulated in do-while(0). Could you give an example here of code that breaks when disregarding this rule?
<t></t>