Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: Problem with functions returning structs Message-ID: <524@crdos1.crd.ge.COM> Date: 26 Sep 89 15:41:36 GMT References: <816@tuminfo1.lan.informatik.tu-muenchen.dbp.de> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center Lines: 18 In article <816@tuminfo1.lan.informatik.tu-muenchen.dbp.de>, boetsch@lan.informatik.tu-muenchen.dbp.de (Ernst Boetsch) writes: | Now my questions: | - Is this behavior a portability problem (I think so) | or did I make a mistake | or does GNUcc generate wrong code? I believe that the way gcc and cc handle functions returning struct is not the same. If this is the case then you have to either generate incorrect C (as you have) to fool the compiler into expecting the native cc conventions, or recompile every library you use with gcc. Using libraries compiled with one compiler with programs compiled with another is always a possible cause of problems with calling sequences. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon