this page is a draft. please help enhancing it by adding lines and filling tables. comments at the bottom of the text are also welcome.
this is just a quick array to recall some of the specifs of the architectures found in the debian project.
feature |
alpha |
amd64 |
arm |
hppa |
i386 |
ia64 |
m68k |
mips |
mipsel |
powerpc |
s390 |
sparc |
size of char |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
size of short |
? |
2 |
2 |
2 |
2 |
2 |
? |
2 |
2 |
? |
? |
2 |
size of int |
4 |
4 |
4 |
4 |
4 |
4 |
? |
4 |
4 |
? |
? |
4 |
size of long |
8 |
8 |
4 |
4 |
4 |
8 |
? |
4 |
4 |
? |
? |
4 |
size of long long |
8 |
8 |
8 |
8 |
8 |
8 |
? |
8 |
8 |
? |
? |
8 |
size of float |
? |
4 |
4 |
4 |
4 |
4 |
? |
4 |
4 |
? |
? |
4 |
size of double |
8 |
8 |
8 |
8 |
8 |
8 |
? |
8 |
8 |
? |
? |
8 |
size of long double |
8 |
16 |
8 |
8 |
12 |
16 |
? |
8 |
8 |
? |
? |
8 |
size of data pointer |
? |
8 |
4 |
4 |
4 |
8 |
? |
4 |
4 |
? |
? |
4 |
endianness |
LE |
LE |
LE |
BE |
LE |
LE |
BE |
BE |
LE |
BE |
BE |
BE |
char signedness |
? |
s |
u |
s |
s |
s |
? |
s |
s |
u |
? |
s |
Signedness
When programming in C, variables can be signed or unsigned.
Example:
unsigned char c;
explicit unsigned, 0 <= c <= 255
signed char c;
explicit signed, -128 <= c <= 127
char c;
implicit (un)signedness, depending on architecture
To force a signedness, either declare it explicitly or use the gcc command line option -f(un)signed-char. The gcc defaults differ only due to optimisation. Other compilers may not have this issue.
Obtaining these information via autoconf
AC_INIT(archtest, 0.1) AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(float) AC_CHECK_SIZEOF(double) AC_CHECK_SIZEOF(long double) AC_CHECK_SIZEOF(void*) AC_C_BIGENDIAN() AC_C_CHAR_UNSIGNED()