From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Skov To: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] RedBoot sending incorrect TCP window size Date: Fri, 09 Feb 2001 06:00:00 -0000 Message-id: References: <20010208105133.A1381@visi.com> <3A82FE61.7F6F2EE8@ri.silicomp.fr> <20010208145836.A2740@visi.com> <200102091340.f19De5J22761@sheesh.cambridge.redhat.com> X-SW-Source: 2001-02/msg00142.html >>>>> "Bart" == Bart Veer 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