Prototypes with old style definitions

Anthony M. Richardson amr at dukee.egr.duke.edu
Wed Feb 7 11:26:20 AEST 1990


Can someone with access to the (proposed?) ANSI standard answer the
following for me?

Does the Standard specify what action should occur when old style
function definitions are preceded by new style declarations?
That is, if we have

=======================
float foo(float, int);

float foo(x, n)
float x;
int n;
{ ......... }
=======================
what does the standard say about parameter conversions in this case?

I see only three possible answers:
(1) foo must assume that x will be passed as a float and must return a float,
    i.e. must obey the prototype,
(2) the standard does not allow mixing of new style declarations and old 
    style definitions,
(3) behavior is implementation dependent.

I guess there could be a (4):
(4) foo must do old style parameter conversions (specifically float -> double),
but this doesn't seem too likely.

Email would be appreciated as I don't subscribe to this group.

Thanks,
Tony Richardson       amr at dukee.egr.duke.edu



More information about the Comp.lang.c mailing list