Bug 22533 – OpenBSD: Use correct size_t compat for 32-bit

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Other
Creation time
2021-11-22T02:27:39Z
Last change time
2021-11-24T08:48:58Z
Keywords
pull
Assigned to
No Owner
Creator
Brian Callahan

Comments

Comment #0 by bcallah — 2021-11-22T02:27:39Z
Hello -- OpenBSD unconditionally defines size_t to be unsigned long (which is legal according to the C spec). However, D assumes size_t to be unsigned int on 32-bit. This doesn't matter, until it matters. It matters when linking together functions with both C++ and D linkage, when using size_t as a parameter to a function that crosses this boundary. LDC does it, and it causes linking LDC on 32-bit OpenBSD to fail. This sets size_t to be unsigned int on 32-bit OpenBSD. In addition, it fixes a compat bug in a separate file where d_size_t is clearly meant, but size_t was used.
Comment #1 by dlang-bot — 2021-11-22T02:28:49Z
@ibara created dlang/dmd pull request #13336 "Fix Issue 22533 - OpenBSD: Use correct size_t compat for 32-bit" fixing this issue: - Fix Issue 22533 - OpenBSD: Use correct size_t compat for 32-bit https://github.com/dlang/dmd/pull/13336
Comment #2 by dlang-bot — 2021-11-24T08:48:58Z
dlang/dmd pull request #13336 "Fix Issue 22533 - OpenBSD: Use correct size_t compat for 32-bit" was merged into master: - 0b0fc552d1144a5a37fd8721ba3df2d3887cabab by Brian Callahan: Fix Issue 22533 - OpenBSD: Use correct size_t compat for 32-bit https://github.com/dlang/dmd/pull/13336