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