Ssize_t should be the signed version of size_t

Currently it’s typedef INT64_TYPE ssize_t;
That’s not valid

AFAIU, the standards only say that ssize_t should be of a type not wider than long. In that sense, I think this definition would be incorrect on 32-bit platforms. Is that what you are pointing out here?


better to be same size for size_t and ssize_t

In musl musl/ at master · lsds/musl · GitHub

The size related types are all _Addr

TYPEDEF unsigned _Addr size_t;
TYPEDEF unsigned _Addr uintptr_t;
TYPEDEF _Addr ptrdiff_t;
TYPEDEF _Addr ssize_t;
TYPEDEF _Addr intptr_t;
TYPEDEF _Addr regoff_t;

For most platform sizeof(ssize_t) == sizeof(size_t) is assumed(GLIBC,MUSL, MSVC,NEWLIB), that’s a de facto and many software are assumed this, otherwise it’s easy leading to issues

MSVC have

#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;