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

clean: fix some issues found by the code analysis of Visual Studio #1953

Merged

Conversation

shenlebantongying
Copy link
Collaborator

@shenlebantongying shenlebantongying commented Nov 14, 2024

It appears that the Visual Studio's Analyze → Run code analyze button is just rebuilding the project, then collect warnings.

Edit: Actually, I don't know what's the rule it follows. It seems CMake (?) project cannot configure it as written in VS's doc. The panel is blank for me.
https://learn.microsoft.com/en-us/cpp/code-quality/quick-start-code-analysis-for-c-cpp?view=msvc-170

This fixes all the default warnings.

Mostly uninitialized variables. Initialize everything religiously.

Comment on lines 104 to 106
}
// Fall-through

[[fallthrough]];
default:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting one.

Comment replaced by cpp17 standard attribute :)

@shenlebantongying shenlebantongying changed the title clean: fix all MSVC default level warnings clean: fix some issues found by the code analysis of Visual Studio Nov 14, 2024
@shenlebantongying shenlebantongying enabled auto-merge (squash) November 14, 2024 12:22
@shenlebantongying shenlebantongying merged commit c5d682c into xiaoyifang:staged Nov 14, 2024
7 checks passed
@shenlebantongying shenlebantongying deleted the clean/no-msvc-warnings branch November 14, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant