Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!hp4nl!ruuinf!piet From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: comp.lang.c Subject: Re: Problem with functions returning structs Message-ID: <1612@ruuinf.cs.ruu.nl> Date: 27 Sep 89 11:27:18 GMT References: <816@tuminfo1.lan.informatik.tu-muenchen.dbp.de> Sender: news@ruuinf.cs.ruu.nl Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Organization: Dept of Computer Science, University of Utrecht, Holland Lines: 24 In-reply-to: boetsch@lan.informatik.tu-muenchen.dbp.de (Ernst Boetsch) In article <816@tuminfo1.lan.informatik.tu-muenchen.dbp.de>, boetsch@lan (Ernst Boetsch) writes: `I had (portability ?) problems with functions returning structs as `result: `Now my questions: `- Is this behavior a portability problem (I think so) ` or did I make a mistake ` or does GNUcc generate wrong code? `- What is the best (most portable) way to handle this problem if it is ` a portability problem. If your GCC is properly configured there is a switch -fpcc-struct-return which you can supply on your gcc command line to get the calling sequence required by cc. `- Is there a similar problem with structs as function parameters (in my ` environment both GNUcc and the native cc handled structs as ` parameters in the same way)? There should be no problem with structs as parameters. -- Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31-30-531806 Internet: piet@cs.ruu.nl Telefax: +31-30-513791 Uucp: uunet!mcvax!hp4nl!ruuinf!piet