Problem with functions returning structs

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Wed Sep 27 01:41:36 AEST 1989


In article <816 at tuminfo1.lan.informatik.tu-muenchen.dbp.de>, boetsch at 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 at 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



More information about the Comp.lang.c mailing list