### Question 20.19

Are the outer parentheses in `return` statements really optional?

Yes.

Long ago, in the early days of C, they were required, and just enough people learned C then, and wrote code which is still in circulation, that the notion that they might still be required is widespread.

(As it happens, parentheses are optional with the `sizeof` operator, too, as long as its operand is a variable or a unary expression.)

References: K&R1 Sec. A18.3 p. 218
ANSI Sec. 3.3.3, Sec. 3.6.6
ISO Sec. 6.3.3, Sec. 6.6.6
H&S Sec. 8.9 p. 254

Read sequentially: prev next up top

This page by Steve Summit // Copyright 1995 // mail feedback