This guide delves into the nuances and pitfalls of undefined behavior in C++, focusing on variadic functions, the subscript operator in associative containers, and intricacies with iostreams. It highlights potential errors and undefined behavior scenarios that can occur with these features, providing practical examples and solutions. The chapter also touches on issues related to zero-sized types in structures and optimizing the size of data structures in C++.

26m read timeFrom pvs-studio.com
Post cover image
Table of contents
Broken syntax and standard library: ellipsis and functions with arbitrary number of argumentsBroken syntax and standard library: operator[] of associative containersBroken syntax and standard library: iostreams — good luck debugging!Broken syntax and standard library: comma operatorBroken syntax and standard library: function-try-blockBroken syntax and standard library: zero-sized types

Sort: