Sujet : Re: technology discussion → does the world need a "new" C ?
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 10. Jul 2024, 23:29:06
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6n1vi$239h6$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
User-Agent : Mozilla Thunderbird
On 7/10/24 14:39, Michael S wrote:
...
... For functions, it happens in
all contexts except function call. Or, may be, including function call,
Actually, it is the latter. In a function call expression:
"The expression that denotes the called function104) shall have type
pointer to function ..." (6.5.2.2p1).
Conveniently,
"A function designator is an expression that has function type. Except
when it is the operand of the sizeof operator69) , a typeof operator, or
the unary & operator, a function designator with type "function
returning type" is converted to an expression that has type "pointer to
function returning type"." (6.3.2.1p4).
In K&R C, the function designator had to have a function type, and there
was no implicit conversion to a pointer, but both of those things were
changed when the language was first standardized.