Bug 24173 – ImportC: add Microsoft iNN integer literal suffixes

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2023-10-04T21:38:15Z
Last change time
2023-10-07T00:46:00Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
dave287091

Comments

Comment #0 by dave287091 — 2023-10-04T21:38:15Z
Apparently MSVC has syntax for 32bit and 64bit integer literal suffix. It’s like: unsigned __int32 s = 0xffffffffui32; unsigned __int64 s2 = 0xffffffffffffffffui64; __int32 s3 = 0xffffffffi32; __int64 s4 = 0xffffffffffffffffi64; __int64 s5 = 12i64; __int32 s6 = 07i32; Encountered this as my copy of <stdint.h> defines SIZE_MAX using these suffixes. I can’t find where these suffixes are documented.
Comment #1 by bugzilla — 2023-10-05T06:00:51Z
It's Microsoft specific: https://learn.microsoft.com/is-is/cpp/c-language/c-integer-constants?view=msvc-160 although there is no mention of i32.
Comment #2 by dlang-bot — 2023-10-06T20:44:03Z
@WalterBright created dlang/dmd pull request #15654 "fix Issue 24173 - ImportC: add Microsoft iNN integer literal suffixes" fixing this issue: - fix Issue 24173 - ImportC: add Microsoft iNN integer literal suffixes https://github.com/dlang/dmd/pull/15654
Comment #3 by dlang-bot — 2023-10-07T00:46:00Z
dlang/dmd pull request #15654 "fix Issue 24173 - ImportC: add Microsoft iNN integer literal suffixes" was merged into master: - 6bf842e290dba4624dcb5e4dafdae5a0f2aa2ce7 by Walter Bright: fix Issue 24173 - ImportC: add Microsoft iNN integer literal suffixes https://github.com/dlang/dmd/pull/15654