Subject: Re: Question on macros...
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 02/26/2007 16:13:24
In article <20070226151206.GA5119@britannica.bec.de>,
Joerg Sonnenberger  <joerg@britannica.bec.de> wrote:
>On Mon, Feb 26, 2007 at 04:04:36PM +0100, Johnny Billquist wrote:
>> Now, why the do-while loop here? I have no problem with the fact that 
>> somestuff should be in a block, but a while-loop that will only be run 
>> once??? Why not just:
>> 
>> #define somemacro(x) \
>>   { \
>>     somestuff; \
>>   }
>
>Doesn't eat the trailing ;
>
>Joerg
>

In more detail, here's where not eating the trailing ; does not work.

if (foo)
	somemacro(x);
else
	foo = 0;

does not work.

christos