Casting Function Pointers

Norman Diamond diamond at jit533.swstokyo.dec.com
Fri May 24 10:56:26 AEST 1991


To clarify my article <1991May24.005025.7714 at tkou02.enet.dec.com>:
>In article <1145 at mwtech.UUCP> martin at mwtech.UUCP (Martin Weitzel) writes:
>>Third and most important: Will the guarantees ANSI C gives with
>>respect to the (identical) representation of certain pointer types
>>extend to the calling sequence of a function?
>
>No.  A function with two parameters might have a different calling sequence
>from a function with zero parameters.  A function with an int parameter might
>have a different calling sequence from a function with a struct parameter.

The identical representation of void* and char* includes their appearance
in calling sequences of functions.  If that is what you meant, then the
answer is yes.  But two pointers to arbitrary function types, while they
must have identical representations, do not have identical calling sequences.
Sorry about overlooking your probably intended meaning.
--
Norman Diamond       diamond at tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Permission is granted to feel this signature, but not to look at it.



More information about the Comp.std.c mailing list