Bug 24504 – ImportC: Enum declarations with a mixture of `int` and `uint` literal values cause errors, when targeting Windows, when debug info generation is enabled.

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2024-04-15T16:43:45Z
Last change time
2024-06-02T10:29:58Z
Keywords
pull
Assigned to
No Owner
Creator
Harry Gillanders

Comments

Comment #0 by contact — 2024-04-15T16:43:45Z
When a C enum has a mixture of `int`s and `uint`s assigned to its values, if the target is Windows, and debug info generation is enabled, the following error will occur for each `int` member of the enum that comes before the first `uint` member: "Error: integer constant expression expected instead of `cast(uint)<value>`". Test case: > // test.c > // REQUIRED_ARGS: -os=windows -g > > typedef enum > { > HasIntAndUIntValuesInt = 0, > HasIntAndUIntValuesUInt = 0x80000000 > } HasIntAndUIntValues;
Comment #1 by contact — 2024-04-15T17:00:14Z
dlang-bot doesn't seem to be picking it up—there's a PR up at https://github.com/dlang/dmd/pull/16385
Comment #2 by dlang-bot — 2024-06-02T09:20:06Z
@ibuclaw created dlang/dmd pull request #16553 "merge stable" fixing this issue: - Fix Bugzilla Issue 24504 - ImportC: Enum declarations with a mixture of int and uint literal values cause errors, when targeting Windows, when debug info generation is enabled. (#16385) https://github.com/dlang/dmd/pull/16553
Comment #3 by dlang-bot — 2024-06-02T10:29:58Z
dlang/dmd pull request #16553 "merge stable" was merged into master: - f053ab07d02bfd93c0f77fdc7a1919eabc6a1057 by Harry Gillanders: Fix Bugzilla Issue 24504 - ImportC: Enum declarations with a mixture of int and uint literal values cause errors, when targeting Windows, when debug info generation is enabled. (#16385) https://github.com/dlang/dmd/pull/16553