home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: sparky!uunet!cis.ohio-state.edu!azu.informatik.uni-stuttgart.de!mattes
- From: mattes@azu.informatik.uni-stuttgart.de (Eberhard Mattes)
- Subject: PCC_BITFIELD_TYPE_MATTERS
- Message-ID: <9301031655.AA03439@azu.informatik.uni-stuttgart.de>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Sun, 3 Jan 1993 18:55:58 GMT
- Approved: bug-gcc@prep.ai.mit.edu
- Lines: 31
-
- 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)
-
-