Prototypes with old style definitions

Walter Murray walter at hpclwjm.HP.COM
Thu Feb 15 09:10:12 AEST 1990


Mark H. Colburn writes:

Concerning the example:

><<	float foo(float, int);
><<
><<	float foo(x, n)
><<	float x;
><<	int n;
><<	{ ......... }

> I was under the impression that the standard allowed parameters to be
> passed between functions without type coersion in this manner as long
> as there was a function prototype in effect.  

That is true, but if you have a parameter of type float and you want
to prevent promotion to double, both the declaration (if given) and
the definition must use prototypes.  This is a case where you can't
mix a prototype declaration and an old-style definition.

Walter
----------



More information about the Comp.lang.c mailing list