Global Information Lookup Global Information

Undefined behavior information


In computer programming, undefined behavior (UB) is the result of executing a program whose behavior is prescribed to be unpredictable, in the language specification to which the computer code adheres. 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".[1]

  1. ^ "nasal demons". Jargon File. Retrieved 12 June 2014.

and 25 Related for: Undefined behavior information

Request time (Page generated in 0.8649 seconds.)

Undefined behavior

Last Update:

In computer programming, undefined behavior (UB) is the result of executing a program whose behavior is prescribed to be unpredictable, in the language...

Word Count : 2564

Undefined

Last Update:

Indeterminate form, in calculus Undefined behavior, computer code whose behavior is not specified under certain conditions Undefined value, a condition where...

Word Count : 135

Unspecified behavior

Last Update:

unspecified, and undefined behavior. The exact definition of unspecified behavior varies. In C++, it is defined as "behavior, for a well-formed program...

Word Count : 687

Fast inverse square root

Last Update:

integer by casting then dereferencing the pointer to it is not valid (undefined behavior). Another way would be to place the floating point value in an anonymous...

Word Count : 4544

C syntax

Last Update:

example, has undefined behavior: printf("%s %s\n", argv[i = 0], argv[++i]); An aspect of the C standard (not unique to C) is that the behavior of certain...

Word Count : 9787

Bitwise operation

Last Update:

multiplication by four. Shifts can result in implementation-defined behavior or undefined behavior, so care must be taken when using them. The result of shifting...

Word Count : 3812

Race condition

Last Update:

standards specify that a C or C++ program containing a data race has undefined behavior. A race condition can be difficult to reproduce and debug because...

Word Count : 4357

Integer overflow

Last Update:

signed integer overflow causes undefined behavior. Run-time overflow detection implementation UBSan (undefined behavior sanitizer) is available for C compilers...

Word Count : 3338

Null pointer

Last Update:

that may be the case in practice. Dereferencing a null pointer is undefined behavior in C, and a conforming implementation is allowed to assume that any...

Word Count : 1652

Sequence point

Last Update:

catastrophic undefined behavior if they share state. This situation can arise in parallel computations, causing race conditions, but undefined behavior can also...

Word Count : 1202

Segmentation fault

Last Update:

memory allocation. Dereferencing a null pointer, which results in undefined behavior, will usually cause a segmentation fault. This is because a null pointer...

Word Count : 2433

Restrict

Last Update:

object is accessed by an independent pointer, this will result in undefined behavior. If the compiler knows that there is only one pointer to a memory...

Word Count : 927

Return statement

Last Update:

returned when the return statement is omitted, while in JavaScript the value undefined is returned. In Windows PowerShell all evaluated expressions which are...

Word Count : 2176

Bitwise operations in C

Last Update:

value results in undefined behavior. For example, when shifting a 32 bit unsigned integer, a shift amount of 32 or higher would be undefined. Example: If...

Word Count : 1863

Union type

Last Update:

y to 10, and does not result in undefined behavior. let z = unsafe { x.baz }; // This results in undefined behavior, as the value stored in x is not...

Word Count : 2589

Increment and decrement operators

Last Update:

operations should be performed. Such expressions generally invoke undefined behavior, and should be avoided. In languages with typed pointers like C, the...

Word Count : 1148

Division by zero

Last Update:

expression 0 0 {\displaystyle {\tfrac {0}{0}}} is also undefined. Calculus studies the behavior of functions in the limit as their input tends to some...

Word Count : 5631

Offsetof

Last Update:

compilers, it has generated some debate regarding whether this is undefined behavior according to the C standard, since it appears to involve a dereference...

Word Count : 939

C dynamic memory allocation

Last Update:

value, without checking if the allocation is successful, invokes undefined behavior. This usually leads to crash (due to the resulting segmentation fault...

Word Count : 4126

Pure function

Last Update:

executing f() concurrently do not result in a data race, which has undefined behavior in C and C++. The following C++ functions are impure as they lack...

Word Count : 1361

Static program analysis

Last Update:

explosion Polyvariance Rice's theorem Runtime verification Safety and liveness Undefined behavior Semantics Analyses Formal methods Category Outline Glossary...

Word Count : 1864

Unreachable code

Last Update:

C++, some constructs are specified to have undefined behavior. A compiler is free to implement any behavior or none, and typically an optimizing compiler...

Word Count : 1324

Type punning

Last Update:

set (otherwise the read has unspecified behavior). The same is syntactically valid but has undefined behavior in C++, however, where only the last-written...

Word Count : 2106

Captive portal

Last Update:

the network with pages already loaded into its web browser, causing undefined behavior (for example, corrupt messages appear) when such a page tries HTTP...

Word Count : 1798

Code sanitizer

Last Update:

sanitizer is a programming tool that detects bugs in the form of undefined or suspicious behavior by a compiler inserting instrumentation code at runtime. The...

Word Count : 1432

PDF Search Engine © AllGlobal.net