Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you wanted portability you would use either long or int_least32_t for your example. On a platform that doesn't have a 32-bit type (E.g. a 24-bit DSP) the C99 standard doesn't require that int32_t exists.

I don't see the problem if you end up with a type that is larger than what you asked for, because (assuming signed arithmetic) it was undefined to overflow anyway.

 help



What you seek is int_fast32_t. At least 32 bits, but more if the compiler would have to waste cycles to shrink values down to 32 bits.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: