Date: Fri, 13 Mar 1998 10:45:36 -0600 From: Jonathan Lemon <jlemon@americantv.com> To: shimon@simon-shapiro.org Cc: "Jonathan M. Bresler" <jmb@FreeBSD.ORG>, freebsd-current@FreeBSD.ORG Subject: Re: A question about sys/sys/queue.h Message-ID: <19980313104536.00177@right.PCS> In-Reply-To: <XFMail.980312215107.shimon@simon-shapiro.org>; from Simon Shapiro on Mar 03, 1998 at 09:51:07PM -0800 References: <199803130339.TAA10294@hub.freebsd.org> <XFMail.980312215107.shimon@simon-shapiro.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 03, 1998 at 09:51:07PM -0800, Simon Shapiro wrote: > > On 13-Mar-98 Jonathan M. Bresler wrote: > > Simon Shapiro wrote: > >> Why was the definition of some macros changed > >> from: > >> > >> #define FOO { ... } > >> > >> to: > >> > >> #define FOO do { ... } while(0) > >> > >> I thought these are the same... > >> > > > > the difference lies in how you use them. > > in the first case one writes "FOO" > > in the second "FOO;" Huh? Did I miss something, or am I too used to gcc? I thought semicolons after braces were optional. The following code works: main() { { printf("hello world!\n"); };;;;;; } All the change does is make the trailing semicolon mandatory. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980313104536.00177>