Path: utzoo!yunexus!ists!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!uakari.primate.wisc.edu!uwm.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: void main() (second proof of n Message-ID: <225800242@uxe.cso.uiuc.edu> Date: 19 Nov 89 01:38:34 GMT Article-I.D.: uxe.225800242 References: <314@charyb.COM> Lines: 20 Nf-ID: #R:charyb.COM:314:uxe.cso.uiuc.edu:225800242:000:782 Nf-From: uxe.cso.uiuc.edu!mcdonald Nov 18 10:48:00 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