Codeing style questions
Parmelan, Edouard
EP510777 at exchange.FRANCE.NCR.com
Fri Dec 18 09:23:41 PST 1998
> 1) in kaffe-1.0.b3/kaffe/kaffevm/readClassConfig.h I see stuff like
> this:
>
> do {
> /* blah, blah, blah */
> } while(0)
>
> How is this semantically different from just opening a block, i.e.:
>
> {
> /* blah, blah, blah */
> }
>
This construct is used as the definition of a macro
function.
Think about that:
if (test)
MACRO(...);
else
with out do { ... } while(0), the compiler
reports an error on 'else'.
if (test)
{
blah blah
};
else
Edouard.
More information about the kaffe
mailing list