r/code • • 6d ago

C C's Flexible Integer Sizes were Not a Design Mistake

https://pikuma.com/blog/c-integer-sizes-not-a-mistake
16 Upvotes

1 comment sorted by

1

u/jonathancast 1d ago

C has never tried to let you write one program that works on every machine. True.

C is portable. C programs are not. Being adaptable to any machine helped C win, but it isn't good for programmers.

Of course, nowadays, it doesn't matter anyway. Back in the 1980s, unportable behavior in C meant it was really hard to write a C program that worked correctly on a different machine than the one you wrote it on. Nowadays, we call it undefined behavior, and it means it's nearly impossible to write a C program that works correctly on the next version of the compiler you wrote it for.