On Tue, Sep 09, 2003 at 01:24:41AM -0500, Warren Turkal wrote:
> When ansifying from K&R code, which order should the arguments come in?
> 
> K&R code:
> int
> blah(x, y)
>   float y;
>   int x;
> { ... }
> 
> Does the K&R code go to (1) or (2)?
> (1)
> int
> blah(int x, float y)
> { ... }
> 
> (2)
> int
> blah(float y, int x)
> { ... }
> 
> I am guessing that (1) is the correct answer.
> 
> Also, can you have K&R and ansi function definitions in the same file?

Hmm,  given the K&R promotion rules,  shouldn't the above be converted
to:

int
blah(int x, double y)
{ ... }

unless you can be sure that there is no code relying upon the fact that
a float argument to this fn is converted to double at invokation?

i.e. initially try and preserve the same stack frame.

DF
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to