Hacker News new | ask | show | jobs
by swinglock 2119 days ago
Yes. ssize_t is signed.
1 comments

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.

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.