-
Notifications
You must be signed in to change notification settings - Fork 724
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
style: fix declarations without initial value #4404
Conversation
CppCheck is failing because of the following errors.
These errors happen because we tend to push variables up to the next scope when dealing with loops. For example, this is s2n_self_talk_min_protocol_version_test.c
Rather than writing a cppcheck suppression for this case, I think we should just move the s2n-tls/codebuild/bin/cppcheck_suppressions.txt Lines 1 to 3 in 6c7cdc8
|
8ba2931
to
496b284
Compare
Now that the manual cbc patch has been fixed, this commit is 100% autogenerated.
852c092
to
fba6597
Compare
Description of changes:
s2n-tls expects that all variable declarations set an initial value. This commit fixes violations of that rules across our codebase. This commit is an automated fix generated using
clang-tidy
.The following script was used to generate the fixes
More documentation on the init-variables check can be found here.
Call-outs:
I plan to add this as a check in the CI, but didn't want to add that into this PR so that this PR would include the minimum manual changes for it to pass CI.
Testing:
This is an automated fix with no expected behavior change. I have a murky recollection that most modern compilers will zero-init by default, but regardless all tests passing in CI should confirm that this is not a behavior change.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.