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).
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)
.