This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Problem with the packed attribute using with "typdef" (gcc-2.95)
- From: "Richard Dabrowski" <dabrowski dot r at stn-atlas dot de>
- To: <bug-gcc at gnu dot org>
- Date: Tue, 4 Mar 2003 14:44:04 +0100
- Subject: Problem with the packed attribute using with "typdef" (gcc-2.95)
- Reply-to: <dabrowski dot r at stn-atlas dot de>
Hi,
I have a problem with the packed attribute using with "typdef" (gcc-2.95):
If I define
typedef struct
{
unsigned short int a;
unsigned short int b;
unsigned long c;
unsigned short int d;
unsigned short int e;
unsigned short int f;
} TEST_T __attribute__ ((packed));
TEST_T test_a;
size_t test;
test = sizeof(test_a);
i see test = 16; // should be 14 !
is this problem known?
what is the solution?
Regards
Richard Dabrowski
------------------------------------------------------------------------
STN ATLAS Elektronik GmbH
Abt. LFG T4
Sebaldsbrücker Heerstraße 235
28305 Bremen
Tel.: +49/421/457-1404
Fax: +49/421/457-1649