compatibility of types

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Jul 12 06:12:01 AEST 1990


In article <1990Jul11.002522.24178 at ccu.umanitoba.ca> rpjday at ccu.umanitoba.ca writes:
>  Can someone tell me if ANSI C considers a type of int[3] in
>a prototype compatible with a type of int[5] in the function
>definition?  And are these compatible with a type of int*?
>A reference to the draft would do nicely (this is a subtle
>way of saying that I would RTFM if I knew which section of
>TFM was what I wanted :-)

It's hard to see how you could not find this:

3.5.4.3 (Funtion Declarators (Incuding Prototypes):  For two function
types to be compatible, ... corresponding parameters shall have
compatible types. ... (For each parameter declared with function or
array type, its type for these comparisons is the one that results
from conversion to a pointer type, as in 3.7.1. ...



More information about the Comp.std.c mailing list