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/12 Message-ID: #1/1 X-Deja-AN: 121838130 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: ues5.cern.ch references: <4aih5k$m1l@topaz.sensor.com> organization: CERN European Lab for Particle Physics newsgroups: comp.sys.dec In <4aih5k$m1l@topaz.sensor.com> ron@topaz.sensor.com (Ron Natalie) writes: >We've been running our application on the AXP (UNIX) for several years ^^^^^^^^^^^^^^^^^ Couldn't be more than 3 :-) >and we came accross something we thought had promise, a flag on the >compiler to use 32 bit pointers. We want to do this not because we >are lazy, but because it's a waste of memory (and we do a lot of pointers). > >Well as soon as we finished the build and our code segv'd we realized >the folly. Despite the fact that you can build 32bit applications, >there is no 32-bit compiled version of system libraries (or am I missing >something). Apparently, you're missing -taso at link time. If you do everything as documented in the man page, the system libraries work with your 32-bit pointers: ues5:~/tmp 11> cat test.c #include int main() { char *msg = "Hello, world!"; printf("%ld\n", (long)sizeof msg); puts(msg); return 0; } ues5:~/tmp 12> cc -c -xtaso_short test.c ues5:~/tmp 13> cc -taso test.o ues5:~/tmp 14> ./a.out 4 Hello, world! ues5:~/tmp 15> cc test.o ues5:~/tmp 16> ./a.out 4 Segmentation fault (core dumped) Dan -- Dan Pop CERN, CN Division Email: danpop@mail.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland