home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / vms / 19306 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.9 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Why does this code crash with ACCVIO? (summary, solution)
  5. Date: 15 Dec 1992 17:07:14 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 29
  8. Distribution: world
  9. Message-ID: <1gl3c2INN970@gap.caltech.edu>
  10. References: <PRZEMEK.92Dec9100328@rrdstrad.nist.gov>,<PRZEMEK.92Dec14171154@rrdstrad.nist.gov>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <PRZEMEK.92Dec14171154@rrdstrad.nist.gov>, przemek@rrdstrad.nist.gov (Przemek Klosowski) writes:
  15. >I suspect that the globalref/globaldef extensions of VAX C 
  16. >are designed to deal with this linker "feature";
  17.  
  18. No, they're to allow you to have variables be global symbols instead of PSECTS.
  19. A lot of stuff in VMS is implemented that way, and to allow C to access such
  20. global symbols, they needed to add a way to declare such references.
  21.  
  22. >I did not attempt
  23. >to use them, even though  GNU CC provides some hacks that emulate 
  24. >globaldef/ref; I believe using them involves declaring mydata[] as:
  25. >    globalref char* mydata;
  26. >instead of 
  27. >    external char mydata[]; 
  28. >
  29. >Is that correct?
  30.  
  31. No.  In exactly one module, you need to declare it
  32.     globaldef char mydata[100];
  33. In all other modules that reference it, you need to declare it
  34.     globalref char mydata[];
  35. --------------------------------------------------------------------------------
  36. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  37.  
  38. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  39. understanding of astronomy is purely at the amateur level (or below).  So
  40. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  41. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  42. hold me responsible for it, but my organization had nothing to do with it.
  43.