Skip to content

sizeof computation fails if small bitfields are present #10

Closed
@ian-ross

Description

@ian-ross

Bug imported from C2HS Trac

Trac ticket created: 2008-08-01T13:41:03-0700; last modified: 2010-04-23T10:22:02-0700


sizeof seems to assume that e.g. <8-bit bitfields of type int32 only take 1 byte.

struct bfs {
  int x:1;
};
diff fail1_ctest.out fail1_test.out
1c1
< __tydef__bfs__: 4

---
> __tydef__bfs__: 1

Environment:

C->Haskell Compiler, version 0.15.2 Rainy Days, 31 Aug 2007
  build platform is "i386-darwin" <1, True, True, 1>
The Glorious Glasgow Haskell Compilation System, version 6.8.3
Darwin $host 9.4.0 Darwin Kernel Version 9.4.0: i386

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions