Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Undefined behavior
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{verify|date=February 2025}} {{Short description|Unpredictable result when running a program}} {{Distinguish|Undefined value|Unspecified 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.<ref>{{cite web|title=What Every C Programmer Should Know About Undefined Behavior #1/3|date=13 May 2011 |url=https://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html|access-date=23 February 2025}}</ref> 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 [[computing platform|platform]] (such as the [[application binary interface|ABI]] or the [[translator (computing)|translator]] documentation). In the [[C (programming language)|C programming community]], undefined behavior may be humorously referred to as "'''nasal demons'''", after a [[comp.* hierarchy|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".<ref>{{cite web|title=nasal demons|url=http://catb.org/jargon/html/N/nasal-demons.html|website=[[Jargon File]]|access-date=12 June 2014}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)