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

Init variable to avoid "may be used uninitialized" warning #2114

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

manastasova
Copy link
Contributor

Previous discussion here: #1185
Similar issues here: 305ec03
Similar issues here: d0501c5#diff-6fde57725bf74f073ccac9d404387d74a39824fbc2465a02cfe37e86e679bbe8R34

Causes CI fails

Issues:

Resolves #P188618529

Description of changes:

Zero variables before use.

Call-outs:

The fail only occurs for gcc-12 with ubuntu2204 on x86_64.
Only variables |ftmp2| and |fourbeta| are caught as maybe uninitialized error: 'var_name' may be used uninitialized [-Werror=maybe-uninitialized].

Testing:

CI tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.92%. Comparing base (e76db6c) to head (582a924).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2114   +/-   ##
=======================================
  Coverage   78.92%   78.92%           
=======================================
  Files         610      610           
  Lines      105121   105123    +2     
  Branches    14904    14902    -2     
=======================================
+ Hits        82967    82971    +4     
+ Misses      21503    21500    -3     
- Partials      651      652    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


// Initialize variables to avoid "may be used uninitialized" warning.
// https://github.com/aws/aws-lc/issues/1185
EC_FELEM delta = {{0}}, gamma = {{0}}, beta = {{0}}, ftmp = {{0}}, ftmp2 = {{0}}, tmptmp = {{0}}, alpha = {{0}}, fourbeta = {{0}};
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: at 134 characters, this line has gotten a little long. you might want to break it up into 2 lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, Will. Addressed.

@justsmth justsmth marked this pull request as ready for review January 14, 2025 22:02
@justsmth justsmth requested a review from a team as a code owner January 14, 2025 22:02
@justsmth justsmth enabled auto-merge (squash) January 14, 2025 22:31
@justsmth justsmth merged commit 0e7c2a7 into aws:main Jan 15, 2025
122 of 126 checks passed
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.

4 participants