The production bug that made me care about undefined behavior(gaultier.github.io)
gaultier.github.io
The production bug that made me care about undefined behavior
https://gaultier.github.io/blog/the_production_bug_that_made_me_care_about_undefined_behavior.html
1 comments
> With this bug, we are in the last case: the Response type is a non-POD struct (due to the std::string data field), so the default constructor is called. Response does not implement a default constructor. This means that the compiler generates a default constructor for us, and in this generated code, each struct field is default initialized. So, the std::string constructor is called for the data field and all is well. Except, the other two fields are not initialized in any way. Oops.