4 ms·
> the fact that K&R didn't specify the size of an int or long complicated matter I disagree. I'm glad they didn't -- we may have been stuck with 2 byte ints an
by madmax96 7y ago
> the fact that K&R didn't specify the size of an int or long complicated matter
I disagree. I'm glad they didn't -- we may have been stuck with 2 byte ints and 4 byte longs!
To quote the standard:
> A "plain" int object has the natural size suggested by the
architecture of the execution environment
If you want a portable assembler, you absolutely need a type like C's int. Meanwhile, stdint.h provides fixed-width integers if you really need them.
- kllrnohj 7y ago> I disagree. I'm glad they didn't -- we may have been stuck with 2 byte ints and 4 byte longs! At least then "long" would have a usage, whereas currently it's entirely dead & useless, and it'd be much easier to deal with printf's string formatting than the PRId64 nonsense. The named-size types (int32_t, etc..) are king anyway