sizeof could not possibly evaluate to some size for a type, unless
two things for a type occur:
a) the type is complete and sizeof will evaluate to appropriate size
b) type is not complete and any sizeof use with incomplete type
results in undefined behavior.
Is 'b' so? If so, where in the standard does it say this?
I only bring this up because of the following:
Breakpoint 1, main () at malloc.c:9
9 foo = malloc(sizeof foo);
(gdb) n
11 return 0;
(gdb) p foo
$1 = 0x80495d8
(gdb) p sizeof foo
$2 = 4
(gdb) list malloc.c:1,15
1 #include <stdlib.h>
2
3 typedef struct foo *FOO;
4
5 int main(void)
6 {
7 FOO foo;
8
9 foo = malloc(sizeof foo);
10
11 return 0;
12 }
(gdb)
--
aegis