Bug 22315 – ImportC: #pragma pack is not implemented
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-09-18T08:10:41Z
Last change time
2021-10-21T21:39:27Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
dave287091
Comments
Comment #0 by dave287091 — 2021-09-18T08:10:41Z
I believe Walter has said that he doesn’t intend to support #pragma pack, but I have discovered some macOS system headers that use the feature. At least, fcntl.h and sys/event.h use the feature in defining some structures.
An example from event.h:
#pragma pack(4)
struct kevent {
uintptr_t ident; /* identifier for this event */
int16_t filter; /* filter for event */
uint16_t flags; /* general flags */
uint32_t fflags; /* filter-specific flags */
intptr_t data; /* filter-specific data */
void *udata; /* opaque user data identifier */
};
#pragma pack()
(I have no idea why pragma pack is even used here, the structure has no padding).
I haven’t studied the headers closely enough to see if ignoring it matters or not.
@WalterBright created dlang/dmd pull request #13166 "fix Issue 22315 - ImportC: #pragma pack is not implemented" fixing this issue:
- fix Issue 22315 - ImportC: #pragma pack is not implemented
https://github.com/dlang/dmd/pull/13166
Comment #6 by dlang-bot — 2021-10-14T19:00:18Z
dlang/dmd pull request #13166 "fix Issue 22315 - ImportC: #pragma pack is not implemented" was merged into stable:
- fc97a3c00146f8ee1a6ae6d89f64b9bbcd80ad34 by Walter Bright:
fix Issue 22315 - ImportC: #pragma pack is not implemented
https://github.com/dlang/dmd/pull/13166
Comment #7 by dlang-bot — 2021-10-21T21:39:27Z
dlang/dmd pull request #13209 "Merge stable into master" was merged into master:
- 3131d4789f3af6fab2040cfcc5897c0113e41335 by Walter Bright:
fix Issue 22315 - ImportC: #pragma pack is not implemented (#13166)
https://github.com/dlang/dmd/pull/13209