Help: VAX C problem

D'Arcy J.M. Cain darcy at druid.uucp
Tue Apr 2 23:37:59 AEST 1991


In article <4072.27f7215c at iccgcc.decnet.ab.com> Stan Brown writes:
>I bet if you stopped 100 C programmers, more than 50 of 'em would tell
>you that parentheses are part of the return statement, just like if,
>while, do, and for.  They're not.

You must be moving in the wrong circles.  Ask around here and I bet hardly
anyone thinks that parentheses are required in the return statement.  However
parentheses are always allowed around *ANY* expression so what's the big deal
if someone wants to put them there?  I bet you also have a problem with:
    if ((a == 1) || (a == 5)) ...

>I don't want to start another religious war (the one on EQU or == is
>enough excitement for me), but since the ( ) don't add anything to a
>return statement I'd suggest leaving them out. 

And I suggest using as many as make you comfortable.  I don't want to
shock anyone but I have been known to do the following and I am totally
unrepentant:
   return(5 + (a * k));

Whitespace doesn't add anything to the program either.  Should we leave
that out as well?

-- 
D'Arcy J.M. Cain (darcy at druid)     |
D'Arcy Cain Consulting             |   There's no government
Toronto, Ontario, Canada           |   like no government!
+1 416 424 2871                    |



More information about the Comp.lang.c mailing list