libprimis icon indicating copy to clipboard operation
libprimis copied to clipboard

Explicitly initialize all member variables in constructors

Open no-lex opened this issue 4 years ago • 0 comments

When constructing new objects, it is best practice to initialize all variables, such that they are assured not to be undefined later when they are to be used. While g++ does not specifically raise a complaint for this (it's not always undefined behavior if used carefully), msvc does, and so does Cppcheck.

Resolving this issue would mean setting all object constructors to set all member variables to some value (0 or nullptr is fine). There are multiple transgressions of this best practice in many files, so a significant number of commits (and potentially multiple pull requests) are expected to resolve this.

no-lex avatar Jan 14 '21 01:01 no-lex