- Signed integer overflow (but not unsigned!)
- Dereferencing NULL pointer or result of malloc(0) // 0 point to virtual memory 0 position. Also a reason why program start memory not 0.
- Shift greater than (or equal to) the width of the operand
- Reading from uninitialized variables
- Modifying a variable more than once in an expression : Sequence point
- Buffer overflow
- Comparing pointers into two different data structures
- Pointer overflow : GCC and pointer overflows
- Modifying a const object (C++) or a string literal
- Negating INT_MIN : Why does -INT_MIN = INT_MIN in a signed, two's complement representation?
- Data races
- Mismatch between new and delete
- Calling a library routine w/o fulfilling the prerequisites
- memcpy with overlapping buffers // copy/copy_if , The source and destination ranges cannot overlap.
- atomic_is_lock_free requires passing in obj shall not be nullptr
- If during the evaluation of an expression, the result is not mathematically defined or not in the range of representable values for its type, the behavior is undefined.
Contest: Craziest Compiler Output due to Undefined Behavior
Undefined Behavior Consequences Contest Winners
What Every C Programmer Should Know About Undefined Behavior #1/3
What Every C Programmer Should Know About Undefined Behavior #2/3
What Every C Programmer Should Know About Undefined Behavior #3/3
Marshall's C++ Musings
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.