-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
I'm sure the story of csize is different from cstring.
Current definition
csize* {.importc: "size_t", nodecl.} = int
## This is the same as the type ``size_t`` in *C*.what interesting is the comment claims csize has the same type as size_t in C.
in reality, when we take a look at C or CPP header file, especially stddef.h, they agree it should be an unsigned int.
CPP doc and GNU C doc also agree size_t should be unsigned int.
if csize is an int, it implies csize can be negative or cannot exceed high(int) which is questionable.
also if it is used in FFI, it can be a subtle bug, very difficult to track down.
mratsim, kaushalmodi, stefantalpalaru and D-Nice
Metadata
Metadata
Assignees
Labels
No labels