Skip to content

Comment on A Special Kind of Hell: intmax_t in C and C++ (2020)parent

Comments

Personal opinion, 'int' is way above NULL as a bad idea.

"int" wasn't a bad idea "back in the day".

Different architectures had all manner of different "native" sizes. 8-bit micros were still relatively expensive even up through mid-1980s. The 80286, for example, was 16-bit and went away only in the early 1990s. IBM AS/400s were still 48-bits through the mid-1990s. Apple was still dealing with non-32 bit clean applications in the mid 90s. Linux running on Alpha was still cleaning up x86-isms in mid 1990s.

C99 finally introduced "stdint.h". By the mid-2000s, everything had converged to 32-bit (or 64-bit).

C11 should have deprecated "int" so that compilers could throw warnings on it. But, then, we still haven't removed K&R signatures from the C standards, so here we are.

IIRC K&R signatures are out in C23.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.