News for hackers. Stuff that matters.
Re:Inside the C Standard Library by mnaydin on Monday January 21, 2019 @09:12AM (#18960445)
"C99 provides a macro SIZE_MAX with the maximum value possible in size_t. C89 doesn’t have it, although you can obtain the value by casting (size_t)-1. This assumes a twos’ complement architecture,..."

The architecture does not have to be two's-complement. The value of the expression (size_t)(-1) will always be SIZE_MAX, the largest number that can be represented in the size_t type. The bit pattern may change depending on the architecture, but the value shall equal to SIZE_MAX.

There are no comments on this comment yet.