hn.today

SDCC – Small Device C Compiler

sdcc.sourceforge.net98 points20 comments
Screenshot of SDCC – Small Device C Compiler

Commenters discussed SDCC as a useful free/open-source C compiler for small MCUs, praising its utility on 8051 and stm8 (blackfawn, MobiusHorizons) while noting gaps in target support such as PIC10/12 (blackfawn, pjmlp suggesting Mikroe alternatives). dmitrygr called it the best OSS 8051 compiler but “buggy as hell,” while hacker_homie and others described it as quirky but serviceable. Joel_Mckay argued that many PIC parts and older toolchains are limited and that modern projects often favor GCC-supported parts like STM32/ESP32 or nRF for better power and features. Jyaif reported building a custom 8051 compiler with an LLM that produced far smaller output and passed SDCC tests, presenting an alternative approach.

Opinion split sharply over correctness versus user error and testing. dmitrygr and raphman gave concrete bug anecdotes (wrong memory access on adds; optimizer removing loops that affected pins), prompting uecker to urge filing bugs. lelanthran attributed some cases to missing volatile annotations, while technothrasher and others said aggressive optimizers can still remove seemingly necessary loops. oasisaimlessly questioned whether independent emulators were used to avoid false confidence; dmitrygr noted two simulators, sim51 and minitel_sim, in testing. Overall the discussion balanced gratitude for SDCC’s availability against real concerns about optimizer and correctness issues and tradeoffs with other toolchains.

Read on sdcc.sourceforge.net20 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.