Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!DGOGWDG5.BITNET!U0012 From: U0012@DGOGWDG5.BITNET ("GWDGV1::MOELLER") Newsgroups: comp.os.vms Subject: VAX C - relative adresses? Message-ID: <8805151447.AA28989@ucbvax.Berkeley.EDU> Date: 11 May 88 12:13:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 17 A question directed at VAX C gurus: I would like to create a static table of address offsets in VAX C, like static base extern item1,item2,... static readonly int tab[size] = {&item1 - &base,&item2 - &base, ...} so I'd have POSITION-INDEPENDENT data only (for use in a shareable image) Now simple adresses (+- offset) are legal initializers in C, but not their difference, so the above program won't compile, while static readonly char *tab[size] = {&item1,&item2,...} is o.k. Do you know of a way to convince VAX C to do the desired (compile-time) initialization? Wolfgang J. Moeller, GWDG, D-3400 Goettingen, F.R.Germany | Disclaimer ... Bitnet/Earn: U0012@DGOGWDG5 Phone: +49 551 201516 | No claim intended