Func Protos with K&R Func Defs

Doug Gwyn gwyn at smoke.brl.mil
Fri Mar 1 03:32:41 AEST 1991


In article <1991Feb28.021715.18153 at athena.mit.edu> jik at athena.mit.edu (Jonathan I. Kamens) writes:
>  In ANSI C, a function declaration must match its definition.  That means
>that if the declaration is prototyped, then the definition must also be
>prototyped, with the same types; if the declaration is not prototyped, then
>the definition cannot be prototyped either.

This is not true.  The types must be compatible, but subject to that
constraint the use of "old-style definitions" is compatible with the
use of prototypes.  (Basically, this means that the declared
parameter types must be those resulting from default argument
promotion, i.e. "widened" types.)



More information about the Comp.lang.c mailing list