Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly initialize all member variables in constructors #196

Open
no-lex opened this issue Jan 14, 2021 · 0 comments
Open

Explicitly initialize all member variables in constructors #196

no-lex opened this issue Jan 14, 2021 · 0 comments
Labels
good first issue This issue is easy to resolve for a novice misimplementation Circumlocutious or redundant implementation

Comments

@no-lex
Copy link
Member

no-lex commented Jan 14, 2021

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 no-lex added misimplementation Circumlocutious or redundant implementation good first issue This issue is easy to resolve for a novice labels Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This issue is easy to resolve for a novice misimplementation Circumlocutious or redundant implementation
Projects
None yet
Development

No branches or pull requests

1 participant