Yan Seiner wrote:
>Anyone know off-hand where I can find a reference to the length of
>various ints on the arm chip?
>
>I need to allocate 16, 32, and 64 unsigned ints, and I don't know if
>such animals exist on the arm....
>
>Also, I've read that the arm can be both big-endian and little-endian.
> How does one go about determining which variant we have? Or is it
>software-set?
>
>--Yan
>
>
Hello Yan,
I use this little bit of C to find out (this is on my DEC Alpha):
~/wip $ cat sizes.c
#include <stdio.h>
#include <stdint.h>
int main( int c, char ** v )
{
printf( "size of char = %ld\n", sizeof( char ) );
printf( "size of short = %ld\n", sizeof( short ) );
printf( "size of int = %ld\n", sizeof( int ) );
printf( "size of long = %ld\n", sizeof( long ) );
printf( "size of long long = %ld\n", sizeof( long long ) );
printf( "size of float = %ld\n", sizeof( float ) );
printf( "size of double = %ld\n", sizeof( double ) );
printf( "size of void * = %ld\n", sizeof( void * ) );
printf( "size of size_t = %ld\n", sizeof( size_t ) );
printf( "size of uintmax_t = %ld\n", sizeof( uintmax_t ) );
return 0;
}
~/wip $ gcc -o sizes sizes.c
~/wip $ ./sizes
size of char = 1
size of short = 2
size of int = 4
size of long = 8
size of long long = 8
size of float = 4
size of double = 8
size of void * = 8
size of size_t = 8
size of uintmax_t = 8
~/wip $ arm-9tdmi-linux-gnu-gcc -o sizes sizes.c
# and now on my TS-7200:
-bash-3.1# ./sizes
size of char = 1
size of short = 2
size of int = 4
size of long = 4
size of long long = 8
size of float = 4
size of double = 8
size of void * = 4
size of size_t = 4
size of uintmax_t = 8
Hope this helps,
Andrew.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|