Bill Cunningham said:
What is the difference in return statements in parenthesis and not. I've
never used return(); I've never had a problem with a return statement. My
compiler is C99 too and there is *no* C11 to it. Are they slow on these?
The syntax of a return statement is:
return expression(opt) ;
For a return statement returning a value, parentheses around
expression harmless but are never necessary. (In my humble opinion
adding optional parentheses is poor style because they make the
return statement look like a function call, which it isn't.)
Parentheses are allowed because an expression in parentheses is a valid
expression, exactly equivalent in type, value, and other characteristics
to the unparenthesized expression. There is no reason for performance
to vary depending on the presence or absence of parentheses.
For a return statement that doesn't return a value (used in a void
function):
return;
parentheses are illegal:
return(); /* syntax error */
This has nothing to do with C99 or C11. In the 1975 version of the C
Reference manual, parentheses were required for a return statement with
an expression. I *think* that they were dropped in the 1978 first
edition of K&R (I'll have to check later).