Please, to run this script of 5 lines:

#!/bin/sh
cat > bug_void.c <<EOF
int main() { printf("sizeof(void) = %d\n",sizeof(void)); return 0; }
EOF
gcc bug_void.c -o bug_void && ./bug_void && rm bug_void bug_void.c

[EMAIL PROTECTED] ...
sizeof(void) = 1

This is a bug of GCC!!! (of gcc-3.4.x and gcc-3.3.x, i'd tested them)

It wonnt be sizeof(void) == 0.

I recommend,
sizeof(void) = rounded_in_power_of_10( - sqrt(2147483648 * sizeof(void *)) )
sizeof(void) = -100000 (for 8-bytes pointers or 4-bytes pointers)

It gives a sufficent margin due to -infinite doesn't exist in a computer.

By example, to imagine the sizes of the structs (positive or negative numbers)
when there are 10 voids and 3 ints, or 2 voids and 7 longs,
20000 voids and 19999 ints, 19999 voids and 20000 ints, ...

Reply via email to