-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
Recently I had a patch where I converted a std::pair<int, vector> to a struct to improve readability:
struct MyStruct {
int errCode;
std::vector items;
};
This change introduced the bug that while std::pair initializes the values to defaults (so the int gets initialized to 0), the struct doesn't do this, meaning that there might be a garbage value in the errCode field.
Can we add a clang-tidy rule to cover this case? Or does Coverity already cover it? See the comments for more info; it seems a memory sanitizer may or may not catch this bug.
- is related to
-
SERVER-20588 Enable MemorySanitizer
- Backlog