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

SubmittedTitle on HNPointsComments
May 12, 2011What Every C Programmer Should Know About Undefined Behavior #1/3 by zeugma15518
Sep 7, 2021What Every C Programmer Should Know About Undefined Behavior by mv95912

Cited in comments

Linked from 72 Hacker News comments by 57 different people, from May 2011 to May 2026.

Most recent:

Search every comment that links here →

More from LLVM Project Blog

All 25 posts →

Related posts from the same era