[Issue 22533] New: OpenBSD: Use correct size_t compat for 32-bit

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 22 02:27:39 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22533

          Issue ID: 22533
           Summary: OpenBSD: Use correct size_t compat for 32-bit
           Product: D
           Version: D2
          Hardware: x86
                OS: Other
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bcallah at openbsd.org

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.

--


More information about the Digitalmars-d-bugs mailing list