---
title: "C's Flexible Integer Sizes Were Not a Design Mistake"
slug: cs-flexible-integer-sizes-were-not-a-design-mistake
url: https://listedarticles.com/articles/cs-flexible-integer-sizes-were-not-a-design-mistake
canonical_url: https://pikuma.com/blog/c-integer-sizes-not-a-mistake
content_type: essay
language: en
published_at: 2026-09-25T12:00:00.000Z
updated_at: 2026-09-27T09:13:02.455Z
author: "Gustavo Pezzi"
author_url: https://pikuma.com
authored_by: human
publisher: "Pikuma"
publisher_url: https://pikuma.com
topics: ["C", "Programming", "Systems Programming", "History", "Hardware"]
license: all-rights-reserved
word_count: 486
reading_minutes: 2
citation: "Gustavo Pezzi, Pikuma. \"C's Flexible Integer Sizes Were Not a Design Mistake.\" 25 Sept 2026. https://pikuma.com/blog/c-integer-sizes-not-a-mistake (all-rights-reserved)"
# The full text follows. The web page shows an extract and sends readers
# to the source above; quote the citation and link the canonical URL.
---

# C's Flexible Integer Sizes Were Not a Design Mistake

> Gustavo Pezzi defends C’s platform-sized integers: how 12–60-bit machines shaped int, why minimum ranges beat fixed widths, and what Lua’s portable C still teaches.

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

**Author:** Gustavo Pezzi  
**Published:** 25 September 2026  
**Source:** [Pikuma](https://pikuma.com/blog/c-integer-sizes-not-a-mistake)

Word sizes, strange machines, and why `int` was never meant to mean 32 bits. C's flexible integer types were not a design mistake. They were how the language achieved portability in a world of 12, 18, 36, and 60-bit computers.

## Integers are Not 32-bits

Observing `sizeof(int)` output 4 seems reasonable on modern machines — but on an old 386, `sizeof(int)` returned 2. Native C integer types (`char`, `int`, `short`, `long`) do not come with a guarantee of how many bytes they occupy.

Since we usually want fixed sizes, we suggest `<stdint.h>` types such as `int8_t`, `uint32_t`, etc. (C99).

## Are Non-Fixed Integer Sizes a Design Mistake?

A fairly common take is that C's platform-dependent integer types were a design mistake. An `int` is 16 bits on one machine and 32 on another; `long` is 64 bits on Linux but 32 on 64-bit Windows. But judging a 1970s design by 2020s conditions misses the point.

## The World Before 8-bit Bytes Won

Machine word sizes in the 1960s–70s included PDP-8 (12-bit), PDP-7 (18-bit), PDP-11 (16-bit), PDP-10 (36-bit), CDC 6600 (60-bit), Cray-1 (64-bit), and many others. Characters weren't consistent either (6-bit, 7-bit ASCII, 9-bit bytes, EBCDIC).

## Where C's Types Came From

BCPL and B were typeless — one machine word. The PDP-11 was byte-addressed; Dennis Ritchie describes how B's model fit poorly. C's `char` gave you the byte; `int` kept the spirit of BCPL's word — the natural integer of the machine. Even today, C11 §6.2.5 says a plain `int` has the natural size suggested by the architecture.

## C Escapes the PDP-11

K&R (1978) already listed type sizes on DEC PDP-11, Honeywell 6000, IBM 370, and Interdata 8/32 — including 16-bit, 32-bit, and 36-bit ints, and 8-bit and 9-bit chars.

## Why Flexible Sizes Were Useful

Fixed 32-bit `int` would have been costly on 16-bit machines (two instructions per op), wasteful on 36-bit machines, and painful on ones'-complement and word-addressed systems. ANSI C standardized *minimum ranges*, not exact sizes.

## A Case Study in Portable C: Lua

Lua's “Clean C” approach asks the compiler what it has via `<limits.h>` and chooses types based on guaranteed ranges — e.g. `LUAI_IS32INT`, instruction types that are “at least 4 bytes,” and `CHAR_BIT`-aware packing in `string.pack`.

## Being Fair: What Hurt

People assumed sizes; the LP64 vs LLP64 split hurt; `<stdint.h>` arrived late. Exact-width types remain optional when the machine lacks that width.

## How Modern Languages Differ

Java, Rust, Zig, Go, and Swift pin down widths because the architecture wars were over — yet many still keep a natural/platform-sized integer (`isize`/`usize`, Go `int`, Swift `Int`).

## Conclusion

Fixed integer sizes would have made C slow or impractical on many 1970s machines. Leaving sizes open, backed by guaranteed minimum ranges, made C run nearly everywhere. It wasn't a mistake. Portability was the whole point.
