# SDCC Small Device C Compiler

12 Hacker News commenters recommended SDCC Small Device C Compiler and 4 criticized it, November 2025 to November 2026. It was recommended in 3 of 13 months.

**Verdict:** Free C compiler for 8051, STM8, Z80 and 6502 microcontrollers, a big step up from assembly. Caveat: quirky, with bugs and a less mature 6502 port.

## Why people recommend it

- Serviceable across many microcontrollers (4 comments): "sdcc is a perfectly good compiler which is sufficient for a lot of 8051 applications" ([source](https://news.ycombinator.com/item?id=46227702)) "I've been using 4.4.0 which is fine for Z80 code" ([source](https://news.ycombinator.com/item?id=46118069)) "Has worked well enough for me on 8051 and stm8" ([source](https://news.ycombinator.com/item?id=49763263))

## What people warn about

- Buggy and quirky output (3 comments): "never ran into "bugs" as in this is just broken, but it's quirky for sure" ([source](https://news.ycombinator.com/item?id=49763255)) "when you have large code, bugs will find you" ([source](https://news.ycombinator.com/item?id=49763331)) "It is buggy as hell, but it is free." ([source](https://news.ycombinator.com/item?id=49763011))
- Immature 6502 code generation (2 comments): "The 6502 port has been usable, but doesn't seem fully mature." ([source](https://news.ycombinator.com/item?id=46113696)) "even if the codegen for 6502 needs a lot of work right now" ([source](https://news.ycombinator.com/item?id=46106498))
- Optimizer removes or mangles code (3 comments): "Slightly larger switch() statement and you'll run into peephole optimizer just eating away at jump target instructions" ([source](https://news.ycombinator.com/item?id=49765559)) "compiler optimized away some 'empty' loops a little bit too aggressively" ([source](https://news.ycombinator.com/item?id=49763399)) "but SDCC indeed ignored 'volatile'" ([source](https://news.ycombinator.com/item?id=49769032))
- Suboptimal generated code (2 comments): "stm8 array access is suboptimal." ([source](https://news.ycombinator.com/item?id=49769282)) "SDCC's output was not optimized" ([source](https://news.ycombinator.com/item?id=49763779))

## Alternatives hackers recommend

- [Fil-C](https://hackerapproved.com/p/fil-c.md): 160 recommend
- [Claude's C Compiler](https://hackerapproved.com/p/claude-s-c-compiler.md): 39 recommend
- [Visual C++](https://hackerapproved.com/p/visual-c-plus-plus.md): 29 recommend
- [Tiny C Compiler (TCC)](https://hackerapproved.com/p/tcc.md): 22 recommend
- [Microsoft Visual C++ compiler (MSVC)](https://hackerapproved.com/p/msvc.md): 20 recommend

## Cite as

Hacker Approved, "SDCC Small Device C Compiler", https://hackerapproved.com/p/sdcc/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
