Unnecessary parenthesis

kenny at m.cs.uiuc.edu kenny at m.cs.uiuc.edu
Wed Jul 6 04:33:00 AEST 1988


/* Written  1:29 pm  Jul  2, 1988 by gwyn at brl-smoke.ARPA in m.cs.uiuc.edu:comp.lang.c */
>	return(0);	/* one wonders why the () are there */

If I were asked to guess, I'd guess it's for the same reason that
things like

	return (0);

crop up in my code as well.  I learned B before I learned C, and B
required that the expression on a return statement be parenthesized,
for no particularly good reason (Although at least one version of B
had return() implemented as a FUNCTION, and not a statement!).

I suspect that Messieurs Kernighan and Ritchie got into the same
habit, for much the same reason, as they were both B programmers
before they did C.  Perhaps dmr can enlighten us?

Kevin



More information about the Comp.lang.c mailing list