Earlier quoted context omitted.
Another perspective is that easily preventable bugs in C arise because the compiler doesn’t stop people from doing them.
I don't understand what it is you expect the compiler to stop. There's nothing actually wrong with the code. It's just written in a platform-dependent manner.
Prior to stdint.h there was no portable way to address this but new code should be written using the type system as intended. Open ended when the minimum is sufficient and larger storage is inconsequential. Exact size when the algorithm requires it.