libprimis
libprimis copied to clipboard
Explicitly initialize all member variables in constructors
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.