What exactly do you mean by this? In what sense is it "really an
operator"? It's a unique thing, with its own special syntax.
It doesn't work like either an operator or a function.
As several others have pointed out, the standard refers to it as the
"sizeof operator"; it doesn't call it a "unary-operator", though it
does describe it in the section on "Unary operators" (C99 6.5.3).
Note that prefix "++" and "--" are described in the same section;
they're also referred to as operators, but are not considered
"unary-operators" either.
It happens to be the only operator in the language whose name is a
keyword rather than a token composed of one or more punctuation
symbols, but it's no less an operator because of that. (It's also
nearly unique in that it doesn't evaluate its operand -- unless, of
course the operand is a VLA (but it's not quite that simple).) I'll
grant you that its uniqueness can cause some confusion, but I find
that it really is easier to think of it as an operator (which implies
that the parentheses in "sizeof(x)" are unnecessary).
And, of course, the fact that the grammar explicitly allows
"sizeof x", where "x" is an expression, reinforces the point.
Note that some languages have a number of operators that use keywords
(For example, Ada has "and", "or", "xor", "not", "mod", "rem", "abs",
"not", even though the fundamental arithmetic operators use the usual
symbols "+", "-", "/", "*".)
There are actually two distinct forms of "sizeof". One of
them is a unary operator whose operand is a "unary-expression".
The other has the syntax "sizeof ( type-name )". I would not have
chosen to call the "sizeof" in the latter an operator; rather,
I would prefer to limit the term "operator" to something that
takes one or more "operands" which are themselves expressions,
and treat "sizeof ( type-name )" as a separate class of expression.
But that's the terminology the authors of the standard chose to use.
Making it look like an operator is "misleading" too; if it was an
operator you ought to be able to write "sizeof int".
Oh? Can you write "- int"?
But anyway, what
do you mean, misleading? Who could it mislead?
I didn't have any particular potential victim in mind. But I dislike
making something look like a function call (or a macro invocation)
when it really isn't.
"return" is a statement; it can't be used in an expression. There
isn't anything for it to be consistent with, and there aren't two
different syntaxes depending on its operand.
"sizeof(x)" looks like a function call, though it isn't.
"return(x)" looks like a function call, though it isn't.
In both cases, in my opinion, that's enough reason not to use
the parentheses.
Of course you should use parentheses if the argument is sufficiently
complex that it's ambiguous, either to the compiler or to a human
reader. There are no such cases for return; there probably are
such cases for sizeof. But in the normal case, I prefer not to
use extraneous parentheses in a sizeof expression other than the
"sizeof ( type-name )" form.