Search code examples
Avoiding UB while reading binary data from std::ifstream...


c++serializationlanguage-lawyerundefined-behavior

Read More
Why is the phrase: "undefined behavior means the compiler can do anything it wants" true?...


c++compiler-constructionundefined-behavior

Read More
is aliasing a plain array to an `std::array` not UB...


c++language-lawyerundefined-behaviorstrict-aliasingstdarray

Read More
What is the strict aliasing rule?...


c++cundefined-behaviorstrict-aliasingtype-punning

Read More
Does FBString's small string optimization rely on undefined behavior?...


c++c++11undefined-behaviortype-punningsmall-buffer-optimization

Read More
Throwing C++ exception through C function call...


c++cfunctionexceptionundefined-behavior

Read More
Type casting char pointer to be of type struct pointer...


cundefined-behaviorstrict-aliasingc17

Read More
Why does Rust disallow mutable aliasing?...


rustundefined-behaviorlifetime

Read More
Do I need to cast to unsigned char before calling toupper(), tolower(), et al.?...


c++language-lawyerundefined-behaviortouppertolower

Read More
Does a const-qualified member function promise not to modify the object? How is this legal?...


c++undefined-behaviormutableconst-cast

Read More
Different outputs for the same line in C when another line is commented...


cfloating-pointprintfundefined-behaviorformat-specifiers

Read More
std::bit_cast padding and undefined behavior...


c++language-lawyerc++20undefined-behaviorbit-cast

Read More
Accessing inactive union member and undefined behavior?...


c++undefined-behaviorlanguage-lawyerunions

Read More
Why is unsigned integer overflow defined behavior but signed integer overflow isn't?...


c++cundefined-behaviorinteger-overflow

Read More
Why does a deducing-'this' lambda require `this` to be a reference or capturing variables by...


c++recursionlambdaundefined-behaviorc++23

Read More
What sequence of operations could possibly have `int i = 1; f(i++, i);` invoke `f(2, 2)`?...


c++c++17undefined-behaviorsequence-points

Read More
Is it undefined behaviour to free a `static restrict` array function parameter?...


clanguage-lawyerundefined-behaviorfreerestrict-qualifier

Read More
When is reinterpret_cast UB?...


c++language-lawyerc++20undefined-behaviorreinterpret-cast

Read More
How can I move std::tuple elements out of a class object?...


c++c++14undefined-behaviormove-semanticsstdtuple

Read More
Is it ok to write `&*string.end()`?...


c++iteratorundefined-behaviordereference

Read More
Is this a well-defined way to access bitfield bits by index in C11...


clanguage-lawyerundefined-behaviorc11bit-fields

Read More
Does union "common initial sequence" include bitfields?...


cunionundefined-behaviorbit-fields

Read More
Is this const_cast in the context of type-erasure undefined behavior?...


c++undefined-behaviorstd-functiontype-erasureconst-cast

Read More
Hide implementation similar to pimpl without heap allocafion...


cundefined-behaviorpimpl-idiomtype-punning

Read More
Is it legal to cast a repr(C) struct pointer to pointer to its first field?...


rustlanguage-lawyerundefined-behavior

Read More
Accessing a struct member from what is not the same struct type...


cpointersstructundefined-behavior

Read More
Is aliasing &mut T in Cell<T> undefined behaviour?...


rustundefined-behavior

Read More
How works - Pointer / Unique_ptr without new...


c++pointersundefined-behaviorunique-ptr

Read More
Difference between Undefined Behavior and Ill-formed, no diagnostic message required...


c++language-lawyerundefined-behavior

Read More
Does the statement `int val = (++i > ++j) ? ++i : ++j;` invoke undefined behavior?...


cundefined-behaviorconditional-operatorsequence-points

Read More
BackNext