🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1564

PCC_BITFIELD_TYPE_MATTERS

#1564
From: Eberhard Mattes
Date: Fri, 18 Dec 1992 19:00
30 lines
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)
Technical Details
Message-ID: <9212181700.AA23050@azu.informatik.uni-stuttgart.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!azu.informatik.uni-stuttgart.de!mattes

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!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: <9212181700.AA23050@azu.informatik.uni-stuttgart.de>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 18 Dec 1992 19:00:15 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 31