🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1524

PCC_BITFIELD_TYPE_MATTERS

#1524
From: Eberhard Mattes
Date: Sun, 03 Jan 1993 18:55
30 lines
1012 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: <9301031655.AA03439@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: <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