From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill C Riemers To: Robert Zitoun Cc: help-gcc@gnu.org Subject: Re: How can I force long words to be 32 bits on DEC-ALPHA ? Date: Wed, 16 Feb 2000 16:49:00 -0000 Message-id: <38AB4593.3A278D84@feynman.com> References: <38AAED04.393536C8@lapp.in2p3.fr> X-SW-Source: 2000-02/msg00058.html Robert Zitoun wrote: > > I have a C-program running on HP in which there are a lot of "unsigned > long*" pointers. > I try to port this program to DEC-ALPHA, but here, Unsigned long > pointers point to 64 bit words. > > Is there any way to force the compiler to understand "long" as 32 bit on > any machine ? (DEC ALPHA especially) > > Thank you for your help > > Robert If you change the size of pointers, you are going have serious problems. How can you possibly hope to address 64 bit memory space with 32 bit pointers???? Perhaps you aren't using them as pointers at all, but pointer offsets. In that case I suspect you will have to modify the code just to use (long int) as indexes, as any automatic porting procedure will get you into trouble. On SGI machines there is a -n32 option, but I think that only sets the default int size. Bill From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill C Riemers To: Robert Zitoun Cc: help-gcc@gnu.org Subject: Re: How can I force long words to be 32 bits on DEC-ALPHA ? Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: <38AB4593.3A278D84@feynman.com> References: <38AAED04.393536C8@lapp.in2p3.fr> X-SW-Source: 2000-q1/msg00252.html Message-ID: <20000401000000.ayuGpzySFRuu7N5gQi5UcPr-u_GLbmB0usgxi90m-ZU@z> Robert Zitoun wrote: > > I have a C-program running on HP in which there are a lot of "unsigned > long*" pointers. > I try to port this program to DEC-ALPHA, but here, Unsigned long > pointers point to 64 bit words. > > Is there any way to force the compiler to understand "long" as 32 bit on > any machine ? (DEC ALPHA especially) > > Thank you for your help > > Robert If you change the size of pointers, you are going have serious problems. How can you possibly hope to address 64 bit memory space with 32 bit pointers???? Perhaps you aren't using them as pointers at all, but pointer offsets. In that case I suspect you will have to modify the code just to use (long int) as indexes, as any automatic porting procedure will get you into trouble. On SGI machines there is a -n32 option, but I think that only sets the default int size. Bill