void main() (second proof of n

mcdonald at uxe.cso.uiuc.edu mcdonald at uxe.cso.uiuc.edu
Sun Nov 19 12:38:34 AEST 1989



>I've used a 6 or so C compilers in 3 very different environments,
>(680x0, 80x86, SPARC), and all of them pass return values in registers.

>The question I have is this: for every C compiler I've used, it doesn't
>matter how many arguments you call a function with.  The return linkage
>will still work, because it's the *caller's* job to fix up the stack
>after the function returns.  Are there any implementations in which this
>is not true? 


Yes. Microsoft C for the 8086 with the /Gc compiler switch. 
In this case the callee restores the stack with a "ret n"
instruction. The return value for integral and pointer types still
goes in registers. The /Gc switch produces minutely faster code.

(I tried e-mail but your address is not known to our nameserver.)

Doug MCDonald



More information about the Comp.lang.c mailing list