Unnecessary parenthesis

Karl Heuer karl at haddock.ISC.COM
Fri Jul 15 06:10:18 AEST 1988


In article <11925 at ism780c.isc.com> marv at ism780.UUCP (Marvin Rubenstein) writes:
|In article <5253 at ihlpf.ATT.COM> nevin1 at ihlpf.UUCP (00704a-Liber,N.J.) writes:
|>Since 'return' can return an expression, parentheses are always allowed
|>(but never required).
|
|This is not quite right.  A procedure may return a void expression.  But
|parantheses may NOT enclose  a void experssion.  Thus statement:
|     return ();
|is [syntactically] malformed.

This is not quite right either.  The empty string does not denote a void
expression.  A void function may not return a void expression, either with or
without the parens: "void f() { return exit(0); }" violates a constraint.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list