Bug 23801 – ImportC: enumeration constant does not fit in an int
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-03-22T22:31:53Z
Last change time
2023-03-28T10:31:22Z
Keywords
pull
Assigned to
No Owner
Creator
dave287091
Comments
Comment #0 by dave287091 — 2023-03-22T22:31:53Z
The system library libdispatch on macOS has an enumeration constant that does not fit in an int. It is more or less defined as so:
enum {
DISPATCH_WALLTIME_NOW = ~1ull,
};
C11 is clear on the subject - enumeration constants must fit in an int. However, clang, gcc and likely other compilers accepted larger constants as an extension.
Additionally, C23 has greatly changed the rules and so the above is now valid when compiling with that standard.
Comment #1 by dlang-bot — 2023-03-25T07:52:08Z
@WalterBright created dlang/dmd pull request #15039 "fix Issue 23801 - ImportC: enumeration constant does not fit in an int" fixing this issue:
- fix Issue 23801 - ImportC: enumeration constant does not fit in an int
https://github.com/dlang/dmd/pull/15039
Comment #2 by dlang-bot — 2023-03-28T10:31:22Z
dlang/dmd pull request #15039 "fix Issue 23801 - ImportC: enumeration constant does not fit in an int" was merged into master:
- 083c24753c915bec3d82aca618c5c83cfe152070 by Walter Bright:
fix Issue 23801 - ImportC: enumeration constant does not fit in an int
https://github.com/dlang/dmd/pull/15039