Skip to content

Support bit-fields

Having C type like:

typedef struct S {
  int f0: 1;
  int f1: 15;
} S;

and hsc code like

#{peek S, f0} p

Causes hsc2hs to fail with

error: attempt to take address of bit-field structure member 'f0'

Apparently this is an error from gcc, which cannot provide the address of bit-fields. However, in Haskell we are not interested in the address of the bit-field but in its value.

It would be useful to have a way to get and set the values of these fields.

Some former discussion here

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component hsc2hs
Test case
Differential revisions
BlockedBy
Related
Blocking
CC mboes, qnikst
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information