return expr and Decus-C

toml at druxm.UUCP toml at druxm.UUCP
Fri May 11 02:59:48 AEST 1984

>	From: gwyn at brl-vgr.UUCP
>	return expr;
>	is preferable to
>	return(expr);
>	since the latter looks like a function call (which it is not).

By this reasoning, we should use "while expr" instead of "while (expr)",
and "if expr" instead of "if (expr)".  And don't forget "switch expr" to
replace "switch (expr)".

My own opinion is that "return (expr)" is clearer, since it clearly
distinguishes between the keyword and the parameter.  I think of this as
a general "thing-to-do (thing-to-do-it-with)" syntax that is consistent
among C commands, functions, and macro pseudo-functions.

		Tom Laidig
		AT&T Information Systems Laboratories, Denver

More information about the Comp.lang.c mailing list