[ECOS] RedBoot sending incorrect TCP window size

Jesper Skov jskov@redhat.com
Fri Feb 9 06:00:00 GMT 2001


>>>>> "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



More information about the Ecos-discuss mailing list