The unpredictable outcome of compiling or executing a program which breaks rules of the language neither compiler, interpreter nor runtime-system have to enforce.
As we know, signed integer overflow is undefined behavior. But there is something interesting in C++11 cstdint documentation: signed integer …
c++ c++11 undefined-behavior integer-overflowAt first glance, this question may seem like a duplicate of How to detect integer overflow?, however it is actually …
c++ c undefined-behavior signed integer-overflowI answered the question about std::vector of objects and const-correctness, and received a comment about undefined behavior. I do …
c++ constants undefined-behavior assignment-operatorI was reading about order of evaluation violations, and they give an example that puzzles me. 1) If a side effect …
c++ language-lawyer undefined-behaviorRegarding division by zero, the standards say: C99 6.5.5p5 - The result of the / operator is the quotient from the …
c++ c undefined-behavior divide-by-zeroI was reading about realloc and got confused about a point mentioned there. Consider the code below: #include <stdio.…
c undefined-behavior reallocWhen adding a named item to a list, is it guaranteed that the item will be added to the end …
r list undefined-behavior insertion namedI have recently started to learn C and I am taking a class with C as the subject. I'm currently …
c debugging undefined-behavior buffer-overflowI know the uninitialized local variable is undefined behaviour(UB), and also the value may have trap representations which may …
c++ c undefined-behavior garbageI was under the impression that accessing a union member other than the last one set is UB, but I …
c++ undefined-behavior language-lawyer unions