Path: utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!onedge.enet.dec.com!farrell From: farrell@onedge.enet.dec.com (Bernard Farrell) Newsgroups: comp.lang.c Subject: Re: Using Macros Message-ID: <14339@shlump.nac.dec.com> Date: 7 Aug 90 16:57:10 GMT Sender: newsdaemon@shlump.nac.dec.com Organization: Digital Equipment Corporation Lines: 34 In article <362.26be9dcc@astro.pc.ab.com>, yoke@astro.pc.ab.com (Michael Yoke) writes... (Some earlier statments removed) >But, if I define the macro like this > > #define A_MACRO { stmt1; stmt2; } > >then the semi-colon at the end of the macro reference screws things up. > When used in for (something) A_MACRO; Michael, the macro expansion would give you: for (something) { stmt1; stmt2; }; [Indentation is mine for clarity]. The presence of an empty statement after the closing brace should not cause any problems, though I seem to recall certain C compilers don't like it being placed here. Bernard Farrell | farrell@onedge.enet.dec.com | Strange but true: often on the move so try | These thoughts are my own invention, home: (617) 332-6203 | I wish I could blame someone else for | them !!