Problem with functions returning structs

Piet van Oostrum piet at cs.ruu.nl
Wed Sep 27 21:27:18 AEST 1989


In article <816 at tuminfo1.lan.informatik.tu-muenchen.dbp.de>, boetsch at 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 at cs.ruu.nl
Telefax:   +31-30-513791      Uucp: uunet!mcvax!hp4nl!ruuinf!piet



More information about the Comp.lang.c mailing list