🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Eberhard Mattes Sun, 03 Jan 1993 18:55
PCC_BITFIELD_TYPE_MATTERS
#1524
Author: 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)
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