Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Eberhard Mattes
Fri, 18 Dec 1992 19:00
PCC_BITFIELD_TYPE_MATTERS
Author: Eberhard Mattes
Date: Fri, 18 Dec 1992 19:00
Date: Fri, 18 Dec 1992 19:00
30 lines
1013 bytes
1013 bytes
If PCC_BITFIELD_TYPE_MATTERS is undefined or 0, the following program
prints 3 instead of 2 (GCC 2.3.1). Is this a bug or a feature? (I
don't fully understand the description of PCC_BITFIELD_TYPE_MATTERS.)
----------
#include <stdio.h>
#include <stddef.h>
#pragma pack(1)
struct demo
{
struct
{
short field1:5;
short field2:5;
short field3:6;
} bits;
char next;
};
int main (void)
{
printf ("%d\n", offsetof (struct demo, next));
return 0;
}
----------
Eberhard Mattes (mattes@azu.informatik.uni-stuttgart.de)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads