return expr and Decus-C - (nf)

ks at ecn-ee.UUCP ks at ecn-ee.UUCP
Mon May 14 12:17:46 AEST 1984


#R:decvax:-47800:ecn-ee:13100012:000:816
ecn-ee!ks    May 13 20:44:00 1984

> Of course the examples aren't legal C, but that's not the
> point.  The question is, if you are worried that
> 
> 	return (expr);
> 
> looks like a function call, why aren't you worried that
> 
> 	while (expr) stat;
> 
> also looks like a function call?  (Remember that 'stat'
> can be the null statement.)  Aren't you being just a bit
> inconsistent?
> 
> -- 
> 	Alan S. Driscoll
> 	AT&T Bell Laboratories

Personally, my perferred style avoids confusion.
If a keyword is followed by a '(', I seperate them by a space.
Admittedly,
	while(expr);
looks like a function call, but
	while (expr)
		;
does not.
Clear style is up to the programmer.
Function calls should "look" like function calls,
macros should look like function calls, but
"return"s should not look like function calls.

				Kirk Smith
				Purdue EE



More information about the Comp.lang.c mailing list