From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,b989a62e3e935740 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-11-01 18:51:33 PST Newsgroups: comp.sys.dec Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!EU.net!CERN.ch!news From: danpop@cernapo.cern.ch (Dan Pop) Subject: Re: Need help investigating a port to a DEC AXP system running OSF/1 Message-ID: Sender: news@news.cern.ch (USENET News System) Organization: CERN European Lab for Particle Physics References: Date: Wed, 2 Nov 1994 00:33:53 GMT In jim@irvine.com (James Zarbock) writes: >It appears that in C on an Alpha which is a true 64 bit machine the >size of the type "int" is 4 bytes and the size of the type "*" >(pointer) is 8 bytes. Period. > >Is there some sort of "32 bit compatibility mode" for the C compiler >that will make the C compiler make longs and pointers 4 bytes? RTFM. From the cc man page: -taso Tell the linker that the executable file should be loaded in the lower 31-bit addressable virtual address range. The -T and -D flags to the ld command can also be used to ensure that the text and data segments addresses, respectively, are loaded into low memory. The -taso flag, however, in addition to setting default addresses for text and data segments, also causes shared libraries linked outside the 31-bit address space to be appropriately relocated by the loader. If you specify -taso and also specify text and data segment addresses with -T and -D, those addresses override the -taso default addresses. The -taso flag is useful for porting 32-bit programs to DEC OSF/1. Of course, there is no compiler option (that I know of) to make long's 32 bit, but you can solve this problem with: #define long int But fixing your code to remove the silly assumptions about the sizes of the different data types is, by far, the best solution. Dan -- Dan Pop CERN, CN Division Email: danpop@cernapo.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland