This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: RedBoot sending incorrect TCP window size
>>>>> "Bart" == Bart Veer <bartv@redhat.com> writes:
Bart> Possibly there should be a gcc extension __packed_sizeof(),
Bart> returning a number that excludes external padding. This would
Bart> not be a complete solution: people would still use sizeof() in a
Bart> non-portable fashion. However it might make it easier to write
Bart> portable code.
IIRC GCC treats one-off struct variables different from arrays of the
same struct. So you may have something like:
typedef struct {
int foo;
char bar;
} __attribute__ ((packed)) icky;
icky a;
icky b[10];
sizeof(a) == 5
sizeof(b[0]) == 8
Or something to that effect (*hand wave*)
Jesper