haskell / haskell/c2hs

#pragma pack not recognized

Open
#172 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
211
Forks
52
PR merge metrics
No merged PRs in 30d

Description

Although `#pragma pack` is not part of the C standard, the most popular compilers support it. Can we make c2hs also recognize it and process it properly so that structs defined under some `#pragma pack` can be have the correct layout in Haskell?

Specifically, the layout of certain structs can be different when using certain `#pragma pack` values, e.g. `#pragma pack(1)`. If c2hs does not recognize `#pragma pack`, the layout it assumes will be different than what the C compiler uses.

There's `#pragma pack (N)`, `#pragma pack(push)` and `#pragma pack(pop)`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.