Casting sizeof() everywhere is ugly (counterpoint: maybe this means we should make a #define isizeof(x) ((int)sizeof(x)) macro instead?
Improve standards conformance of libc string functions (counterpoint: we use char instead of int and some non-standard function signatures already)
Compiler builtins assume memcpy/memmove/memset take size_t and synthesize calls accordingly, so on the off chance we ever want to support 64-bit, we'll get mismatched argument types (although I guess since x64 uses fastcall, it probably won't explode immediately?)
malloc() and friends are odd-ones-out (since myalloc was originally an external project)
I think getting the OS to compile with -Wconversion would be pretty cool, and using int makes it a lot harder
I don't want to change the return type of syscalls (for uniformity/OCD reasons); this effectively means that all syscalls are still limited to reading 2GB at a time. Which is fine; we need to limit the range to half of size_t anyways since the return value needs to encode an error bit.
Arguments for doing this:
#define isizeof(x) ((int)sizeof(x))
macro instead?char
instead ofint
and some non-standard function signatures already)memcpy
/memmove
/memset
takesize_t
and synthesize calls accordingly, so on the off chance we ever want to support 64-bit, we'll get mismatched argument types (although I guess since x64 uses fastcall, it probably won't explode immediately?)malloc()
and friends are odd-ones-out (since myalloc was originally an external project)-Wconversion
would be pretty cool, and usingint
makes it a lot harderI don't want to change the return type of syscalls (for uniformity/OCD reasons); this effectively means that all syscalls are still limited to reading 2GB at a time. Which is fine; we need to limit the range to half of
size_t
anyways since the return value needs to encode an error bit.