'C' Operators precedence

Hartmut Niemann (niemann@cip.e-technik.uni-erlangen.de)
Wed, 20 May 1998 16:40:22 +0200 (MESZ)


>WRONG. See ANSI C standard section 6.3.2.2 Function Calls: `The
>expression that denotes the called function shall have type pointer to
>function...', or Example 2 following section 6.7.1, which explicitly
>shows that (*funcp)() is equivalent to funcp(), when funcp is declared
>as int (*funcp)(void).

Somewhere I read something like:
C operator precedence, practical subset:
(1) * and / precede + and -
(2) everything else will be grouped by ( and )

('Practical C programming' from O'Reilly??)

You don't assume that everybody understands
funcp()
as an abbreviation of
(* funcp)()
do you? At least the second one makes clear that funcp is not a function
defined.
So even if ANSI, POSIX and the gcc and it's manual agree, that the first
(funcp() without parentheses) is legal, does it make sense to use this
form?

Hartmut

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu