3 ms·
stdint.h was introduced in C99, yes? There's a lot of code that started before that and hasn't been converted to newfangled things.
by greglindahl 8y ago
stdint.h was introduced in C99, yes? There's a lot of code that started before that and hasn't been converted to newfangled things.
- kllrnohj 8y ago> newfangled things stdint.h is nearing 20 years old now, I don't think it counts as a "newfangled thing" anymore. But yes, there is plenty of very obsolete software still out there.
- beefhash 8y ago> stdint.h is nearing 20 years old now, I don't think it counts as a "newfangled thing" anymore. In the world of C, it is. Custom compilers for particular embedded systems, such as MCUs, often only speak C89 and nothing else. C99 still hasn't found complete and widespread acceptance.
- kllrnohj 8y agoThe compiler is irrelevant here as stdint.h can come from a variety of sources. There's no reason to not have stdint.h, even on ancient as dirt embedded systems stuck on C89. Even in the worst case of there's no vendor-provided one you can still just define it yourself using a copy from almost anywhere else, there's very little to it.
- beefhash 8y agostdint.h can't be reliably be premade. A compiler is completely free to, say, define sizeof(unsigned int) to anything as long as it can represent at least 65535. stdint.h has to work with the C base types, so it does have to be customized for a particular compiler.
- jcelerier 8y agothat's assuming your compiler even ships any kind of library outside of a header for your hardware's specific functions