Undefined behavior

In computer programming, a program exhibits undefined behavior (UB) when it contains, or is executing code for which its programming language specification does not mandate any specific requirements.[1] This is different from unspecified behavior, for which the language specification does not prescribe a result, and implementation-defined behavior that defers to the documentation of another component of the platform (such as the ABI or the translator documentation).

In the C programming community, undefined behavior may be humorously referred to as "nasal demons", after a comp.std.c post that explained undefined behavior as allowing the compiler to do anything it chooses, even "to make demons fly out of your nose".[2]

  1. ^ "What Every C Programmer Should Know About Undefined Behavior #1/3". 13 May 2011. Retrieved 23 February 2025.
  2. ^ "nasal demons". Jargon File. Retrieved 12 June 2014.

© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search