Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread Benno
On Fri Sep 30, 2005 at 10:28:18 +1000, Ian Wienand wrote: >On Fri, Sep 30, 2005 at 10:22:33AM +1000, Benno wrote: >> (Of course using printf then becomes a real bitch...) > >What's wrong with the PRI macros in inttypes.h? > Compare: uint32_t foo = 0x37; uintptr_t bar = (uintptr_t) &foo; printf("F

Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread Ian Wienand
On Fri, Sep 30, 2005 at 10:22:33AM +1000, Benno wrote: > (Of course using printf then becomes a real bitch...) What's wrong with the PRI macros in inttypes.h? -i signature.asc Description: Digital signature -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription inf

Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread Benno
On Fri Sep 30, 2005 at 10:17:03 +1000, Erik de Castro Lopo wrote: >Robert Collins wrote: > >> I'd try 64-bit sparc, ia-64 and amd-64 in 64 bit mode for comparison. > >This is OS dependant. > >All 64 bit Linux versions use the LP64 model where longs and >pointers are 64 bit. Solaris on UltraSparc do

Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread Erik de Castro Lopo
Robert Collins wrote: > I'd try 64-bit sparc, ia-64 and amd-64 in 64 bit mode for comparison. This is OS dependant. All 64 bit Linux versions use the LP64 model where longs and pointers are 64 bit. Solaris on UltraSparc does the same and I haven't played with Solaris on amd-64 so I can't say. I

Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread Robert Collins
On Fri, 2005-09-30 at 09:29 +1000, Erik de Castro Lopo wrote: > Many OSes support both 32 and 64 bit executables. To know > which type your executable is, you should also print > sizeof(void*) which will always be 8 in a 64 bit executable > and 4 in a 32 bit executable. mmm. Not entirely true.

Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread Peter Rundle
If you add a sizeof(void*) to the above I wouldn't be surprised if you find you have a 32 bit executable and need a command line option to create a 64 bit executable. yep void * returns 4. I'm sure there is a compile option, but I couldn't see it at a quick glance. However the point is made th

Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread Erik de Castro Lopo
Peter Rundle wrote: > Compiled on a Dec Alpha running OpenVMS 7.2 > > VMS>run test.exe > size of a char is 1 > size of a short is 2 > size of a int is 4 > size of a long is 4 > size of a float is 4 > size of a double is 8 > > Bit surprised, I expected a long to be 8 but there you go. Many OSes

Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread O Plameras
Peter Rundle wrote: O Plameras wrote: Does anybody have a 64-bit computer ? Are you able to compile and run the following code and publish the results ? Compiled on a Dec Alpha running OpenVMS 7.2 VMS>run test.exe size of a char is 1 size of a short is 2 size of a int is 4 size of a lo

Re: [SLUG] Output from 64 bit machine

2005-09-29 Thread telford
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Sep 30, 2005 at 08:12:53AM +1000, Peter Rundle wrote: > Compiled on a Dec Alpha running OpenVMS 7.2 > > VMS>run test.exe > size of a char is 1 > size of a short is 2 > size of a int is 4 > size of a long is 4 > size of a float is 4 > size of

[SLUG] Output from 64 bit machine

2005-09-29 Thread Peter Rundle
O Plameras wrote: Does anybody have a 64-bit computer ? Are you able to compile and run the following code and publish the results ? Compiled on a Dec Alpha running OpenVMS 7.2 VMS>run test.exe size of a char is 1 size of a short is 2 size of a int is 4 size of a long is 4 size of a float