Parentheses around return.

tektronix!tekmdp!bronze!jimb tektronix!tekmdp!bronze!jimb
Tue Mar 29 10:56:59 AEST 1983


It's not necessary to change C to enjoy this "feature".  Simply
supplying the optional parentheses should cause any C compiler to
detect the "missing" semicolon, though the message may not be as nice
as one would like.  The vax/pcc compiler flags the following fragment
as a "syntax" error on the line containing "printf".

	return (expr)
	printf (..);

If you don't like the parentheses, you can omit them.  I usually omit
the parentheses so return is better distinguished from function calls.

I generally find distasteful any nit-picking about language syntax.
I've learned many languages, and find that, after some practice, I can
adapt to most any syntactic conventions.

In the long run, most time is spent debugging my own logic. I submit
that most languages provide comparable support for this, independently
of the quality of a person's individual programming abilities.

	Jim Besemer
	ucbvax!tektronix!tekmdp!jimb
	Design Automation Division
	Tektronix



More information about the Comp.lang.c mailing list