www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22533] New: OpenBSD: Use correct size_t compat for 32-bit

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 puremagic.com
          Reporter: bcallah 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.

--
Nov 21 2021