From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9ae5fbc502f16fef X-Google-Attributes: gid1164f8,public From: danpop@mail.cern.ch (Dan Pop) Subject: Re: Compiler flags of dubious utility. Date: 1995/12/15 Message-ID: #1/1 X-Deja-AN: 121941107 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: ues5.cern.ch references: <4akv6t$14i@topaz.sensor.com> <4akvcr$16q@topaz.sensor.com> <4aqnhp$dpn@usenet.pa.dec.com> organization: CERN European Lab for Particle Physics newsgroups: comp.sys.dec In <4aqnhp$dpn@usenet.pa.dec.com> mogul@pa.dec.com (Jeffrey Mogul) writes: >Possible pragmas: > #pragma pointer_size (short) >means declarations use 32-bit pointers until otherwise specified > #pragma pointer_size (long) >means declarations use 64-bit pointers until otherwise specified > #pragma pointer_size (save) >saves current pointer-size on a stack of some sort > #pragma pointer_size (restore) >pops the stack value > >(It's not my fault that they used "short" here to mean "32 bits".) > >As far as I can tell, "-xtaso_short" really means "-xtaso, but >also insert a #pragma pointer_size (short) at the start of the >module." As you've found out, this is not such a good idea because >most modules include header files that declare structures that >are shared with 64-bit library routines. The idea is good, the implementation of the system header files is bad :-( >Generally, sticking a "#pragma pointer_size (short)" after all >the system #includes does the right thing. No, this is a workaround. The right thing would have been for the header files to protect the sensitive declarations with: #pragma pointer_size (save) #pragma pointer_size (long) ... #pragma pointer_size (restore) and avoid the programmer the need for messing with these pragmas in his code. Ditto for the char **argv issue, which is trivial to implement within the compiler (the second and third arguments of main are handled as special cases) or, even better, in the startup module, which could build the right type of pointer arrays, according to the actual type of argv and envp. Dan -- Dan Pop CERN, CN Division Email: danpop@mail.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland