home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / gcc / bug / 3105 < prev    next >
Encoding:
Text File  |  1993-01-03  |  971 b   |  44 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!azu.informatik.uni-stuttgart.de!mattes
  3. From: mattes@azu.informatik.uni-stuttgart.de (Eberhard Mattes)
  4. Subject: PCC_BITFIELD_TYPE_MATTERS
  5. Message-ID: <9301031655.AA03439@azu.informatik.uni-stuttgart.de>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sun, 3 Jan 1993 18:55:58 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 31
  12.  
  13. If PCC_BITFIELD_TYPE_MATTERS is undefined or 0, the following program
  14. prints 3 instead of 2 (GCC 2.3.1). Is this a bug or a feature? (I
  15. don't fully understand the description of PCC_BITFIELD_TYPE_MATTERS.)
  16.  
  17. ----------
  18. #include <stdio.h>
  19. #include <stddef.h>
  20.  
  21. #pragma pack(1)
  22.  
  23. struct demo
  24. {
  25.   struct
  26.     {
  27.       short field1:5;
  28.       short field2:5;
  29.       short field3:6;
  30.     } bits;
  31.   char next;
  32. };
  33.  
  34. int main (void)
  35. {
  36.   printf ("%d\n", offsetof (struct demo, next));
  37.   return 0;
  38. }
  39.  
  40. ----------
  41.  
  42. Eberhard Mattes (mattes@azu.informatik.uni-stuttgart.de)
  43.  
  44.