I don't see the logic of your last sentence.
It's a matter of style, which means we will never resolve the issue.
The difference between a unary operator and a single-argument function
is just a matter of syntax. The grammar for unary operator
application allows it to look like a function call, so why shouldn't
it?
For the same reason that I prefer
return 42;
over
return(42);
I usually put spaces around operators. "sizeof" is just another
operator (even though it's the only one represented by a keyword
rather than by a delimiter), so why should it be any different?
On the other hand, I just realized that I usually *don't* put a space
after a unary operator (-x, &obj, *ptr), which weakens the argument a
bit.
"if" statements are not "while" statements, but can look the same
except for the keyword. Should we adopt some syntactic convention
to make them look different?
Absolutely. I suggest distinguishing between them by using different
keywords.
}
There are several constructs in C that *can* look like function calls
at first glance, and I like to use layout tricks to make them look
different. I avoid extraneous parentheses on return statements, I
leave a space after "if" and "while", I use upper case for macros, and
so forth. Avoiding parentheses in "sizeof obj", and adding a space in
"sizeof (type)" are the same kind of thing.
Having said that, it's not a big deal. I have no problem reading
"sizeof(int)" rather than "sizeof (int)" in someone else's code
(because I *know* sizeof is an operator), but I'll probably start
using "sizeof (int)" in my own code (unless I forget).