C23 lets you pick an enum's underlying type, shrinking it from 4 bytes to 1
lemire · x · 2026-09-02
Daniel Lemire walks through a practical C23 feature: enums can now declare their underlying type. Traditionally compilers picked int (4 bytes) for something like enum status {OK = 0, ERROR = -1};; in C23 you can write enum status : int8t {...} to use just 8 bits, or widen to uint64t for large values. Useful for reducing or pinning memory layout, verified with staticassert — a technique you can apply immediately.
More from coding & agent
- Merge launches enterprise AI governance tool enforcing model routing and spend rules — shensi · 2026-09-02
- Weaviate Ask Mode Adds Configurable Evaluation to Trade Latency vs Verifiability — CShorten30 · 2026-09-02
- Building the Ultimate Agent Harness for Kimi K3: The Model Is No Longer the Bottleneck — VibeMarketer_ · 2026-09-02
- GLM 5.2 slug references spotted in Google Antigravity CLI, hinting at integration — gaganghotra_ · 2026-09-02
- Design lead ships 12 PRs in a week: AI is erasing the designer-engineer gap — talkaboutdesign · 2026-09-02
- Measuring MCP servers: 78% of fixed token cost comes from tool schemas — Lexeik · 2026-09-02