[Issue 21535] New: dtoh: Insufficient size_t/ptrdiff_t detection

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 9 17:27:26 UTC 2021


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

          Issue ID: 21535
           Summary: dtoh: Insufficient size_t/ptrdiff_t detection
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: kinke at gmx.net

In root/bitarray.d:

struct BitArray
{
    alias Chunk_t = size_t;
    enum ChunkSize = Chunk_t.sizeof;
    enum BitsPerChunk = ChunkSize * 8;

    size_t len;
    size_t *ptr;
}

In frontend.h:

struct BitArray
{
    typedef uint64_t Chunk_t;
    enum : uint64_t { ChunkSize = 8LLU };

    enum : uint64_t { BitsPerChunk = 64LLU };

    size_t len;
    uint64_t* ptr;
}

`Chunk_t` and `ptr` probably can and should be fixed; not sure about the 2
size-related enums.

--


More information about the Digitalmars-d-bugs mailing list