Skip to content

Add cppcoreguidelines-init-variables clang-tidy check and fix warnings #3750

@dbarker

Description

@dbarker

The cppcoreguidelines-init-variables check is currently disabled and there are uninitialized variables in the codebase. This issue is to turn on the check and fix the new warnings.

See https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/init-variables.html

Checks whether there are local variables that are declared without an initial value. These may lead to unexpected behavior if there is a code path that reads the variable before assigning to it.

This rule is part of the Type safety (Type.5) profile and ES.20 from the C++ Core Guidelines.

Only integers, booleans, floats, doubles and pointers are checked. The fix option initializes all detected values with the value of zero. An exception is float and double types, which are initialized to NaN.

Metadata

Metadata

Assignees

Labels

triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions