LLVM Project Blog company blog
What Every C Programmer Should Know About Undefined Behavior #1/3
People occasionally ask why LLVM-compiled code sometimes generates SIGTRAP signals when the optimizer is turned on. After digging in, they find that Clang generated a "ud2" instruction (assuming X86 code) - the same as is generated by __builtin_trap().
- Points
- 155
- HN comments
- 30
- Submissions
- 2
- Cited by
- 57 commenters
Software EngineeringProgramming Languages2011
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| May 12, 2011 | What Every C Programmer Should Know About Undefined Behavior #1/3 by zeugma | 155 | 18 |
| Sep 7, 2021 | What Every C Programmer Should Know About Undefined Behavior by mv9 | 59 | 12 |
Cited in comments
Linked from 72 Hacker News comments by 57 different people, from May 2011 to May 2026.
Most recent:
- circuit10 · May 20, 2026
- Arch-TK · Dec 11, 2024
- rwmj · Dec 11, 2024
- anderskaseorg · Jul 29, 2024
- nlewycky · Aug 20, 2023
- dale_glass · Aug 20, 2023