Hacker News new | ask | show | jobs
by moonchild 2119 days ago
ssize_t should never be used.

It's not guaranteed to have a full negative range, only to be able to represent -1.

Use ptrdiff_t as a signed size type.

1 comments

Out of curiosity, do you know of any implementations where ssize_t has that kind of range limitation?
Nope. But I do know of at least one implementation where it's not present at all—msvcrt. ssize_t isn't specified in the c standard, it's part of posix. ptrdiff_t is standard.