packed attribute under m68k and :0...
Stephane Dalton
Stephane.Dalton@abl.ca
Mon Jun 5 14:07:00 GMT 2000
Hi there,
I'm using m68k-elf gcc and I have a question about the use of the :0
delimiter in bitfields. Here's an example of the problem I experimented.
typedef unsigned char Uint8;
typedef struct
{
Uint8 test1:1;
Uint8 test2:2;
Uint8 test3:3;
Uint8 test4:1;
Uint8 :0;
} __attribute__ {{packed}} test_struct;
Using this and gdb-4.18 if I type p sizeof(test_struct) I get 2.... it means
that this struct is two bytes long which is obviously not what I want. I've
read the related section about bitfields in ANSI C, and I found that this
kind of construct is supposed to allocated a new Uint8 if and only if this
something following it.
Is it a bug in gcc or do I misunderstand something...
Thanks
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list