home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / gcc / help / 1895 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.6 KB  |  37 lines

  1. Newsgroups: gnu.gcc.help
  2. Path: sparky!uunet!stanford.edu!ames!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!newsaintmail
  3. From: sim@mdtf14.fnal.gov (Jim Sim)
  4. Subject: Incompatibility in passing structures and unions to SunOS system calls
  5. Message-ID: <SIM.92Aug12124839@mdtf14.fnal.gov>
  6. Sender: daemon@linac.fnal.gov (The Background Man)
  7. Nntp-Posting-Host: mdtf14.fnal.gov
  8. Organization: Fermilab, Batavia, IL
  9. Distribution: usa
  10. Date: Wed, 12 Aug 1992 18:48:39 GMT
  11. Lines: 24
  12.  
  13. When I call semctl, which receives a union as one of its arguments, from a 
  14. program compiled with the SunOS cc compiler, my program works.  When I compile
  15. the same program with gcc, the program aborts.
  16.  
  17. Similarly, when I call lwp_yield, which receives a structure as its argument,
  18. from a program compiled with the SunOS cc compiler, my program works.
  19. When I compile the same program with gcc, the program aborts.
  20.  
  21. If I modify either program to pass the address of the union or structure
  22. and compile with gcc, the program works.  I did this because I was once told
  23. that the SunOS cc compiler passes structures and unions by address.
  24.  
  25. Is there a gcc compiler option that will pass unions and structures in 
  26. a manner that is compatible with the SunOS cc compiler?
  27.  
  28. Can anyone explain the differences in how the SunOS cc compiler and the 
  29. gcc compiler pass unions and structures?  
  30.  
  31. If there is not a compiler option to make union/structure passing 
  32. compatible, what is the best way to write the code so that it will work 
  33. with either compiler when making calls to system services that receive 
  34. unions or structures?
  35.  
  36.  
  37.