← Back to context

Comment by sicariusnoctis

4 years ago

> Remember that in C "undefined behavior" [...] means that a conforming implementation can do literally anything. In the worst case, it will do what what you expect until it fails at the most inconvenient possible moment.

Actually, the worst case possibility is that your program will become Skynet, enslave humanity for 10000 years, collapse all stars in the universe into black holes, and significantly accelerate processes such as the heat death of the universe.

It's even allowed for the program to change all extant texts of the Standard to indicate that its behavior is well-defined.