Using Macros

Stephen Clamage steve at taumet.com
Thu Aug 9 01:27:14 AEST 1990


farrell at onedge.enet.dec.com (Bernard Farrell) writes:

|In article <10836 at crdgw1.crd.ge.com>, volpe at underdog.crd.ge.com (Christopher R Volpe) writes...

|	if (blah)
|	{
|	    stmt1;
|	    stmt2;
|	};
|>           
|>Can someone with a copy of the Standard tell us if a semicolon is 
|>allowed? ...
|... I believe K&R (n) was probably placating Pascal converts, and meant
|no semicolon necessary.

The problem comes when you attach an "else" clause:
	if (blah)
	{
	    ...
	};
	else { ... }
The semicolon is illegal there (or the "else" is illegal, take your pick).

And of course, following the closing brace of a function with a
semicolon is illegal (in ANSI C).
-- 

Steve Clamage, TauMetric Corp, steve at taumet.com



More information about the Comp.lang.c mailing list