This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]