Skip to content

On C extensions, portability, and alternative compilers

5.5 relevance
Score Breakdown
technical depth
8
novelty
5
actionability
4
community
5
strategic
3
personal
5

Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.

Deep technical article on C extensions and portability, relevant to engineering but not AI/cloud core.

General lemon.rip
Summary

Writing portable C code is impractical because real-world code relies on non-standard extensions and library quirks; glibc’s sys/cdefs.h uses GCC-predefined macros to conditionally map __attribute__((packed)) for structs like epoll_event, where ignoring it breaks ABI on 64-bit. POSIX also requires limits.h to define system-specific constants, forcing compilers to include platform files alongside builtins, and SDL_endian.h attempts to use GCC-style inline assembly even for unknown compilers that define ISA macros. These examples highlight how deeply embedded compiler assumptions create barriers for alternative C compilers, a reality the author experienced while building their own.