Is intmax_t the same as long long int?

c, posix

Solution

No. `intmax_t` can be an extended integer type larger than `long long`. I'm not aware of any systems that have it defined as such, but you should not assume in application code that they're the same. (Assuming they're the same in OS code may be acceptable if your OS always guarantees that, but it's still probably a bad idea.)

Problem

By POSIX, `intmax_t` designates a signed integer type capable of representing any value of any signed integer type. Would it be correct that in C99/C11 that `intmax_t` is always the same size as `long long int`?

Original source