Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!attcan!lsuc!ncrcan!ziebmef!mdfreed From: mdfreed@ziebmef.uucp (Mark Freedman) Newsgroups: comp.lang.c Subject: Re: return(struct) implementation Message-ID: <1989Mar18.144546.10605@ziebmef.uucp> Date: 18 Mar 89 19:45:45 GMT References: <4425@pt.cs.cmu.edu> <11977@haddock.ima.isc.com> Reply-To: mdfreed@ziebmef.UUCP (Mark Freedman) Organization: Ziebmef Public Access Unix, Toronto, Ontario Lines: 16 In article <11977@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >In article <4425@pt.cs.cmu.edu> marcoz@MARCOZ.BOLTZ.CS.CMU.EDU (Marco Zagha) writes: >>Can anybody explain how returning a structure from a function is >>typically implemented. Assume it is too big to use registers. > >Some broken implementations use a static area in the callee and just return >its address. This mechanism is not reentrant, is forbidden by the pANS, and >will be considered no further in this article. > That implies that 1) the MS-DOS implementations with which I'm familiar (Turbo-C 2.0, Datalight C 3.05, Lattice C 3.10), and probably several with which I'm not, are broken 2) the marketeers for these companies have gotten a bit carried away when claiming dpANS compliance. Is anyone aware of MS-DOS compilers which implement structure returns according to dpANS ? Is anyone aware of software companies which intend to correct the broken implementation ?