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

valueflow.cpp: fixed -Wmaybe-uninitialized GCC warning in optimized build #6430

Merged
merged 1 commit into from
May 23, 2024

Conversation

firewave
Copy link
Collaborator

lib/valueflow.cpp: In function ‘const Token* ValueFlow::solveExprValue(const Token*, const std::function<std::vector<long long int>(const Token*)>&, Value&)’:
lib/valueflow.cpp:8405:28: warning: ‘intval’ may be used uninitialized [-Wmaybe-uninitialized]
 8405 |             value.intvalue /= intval;
      |             ~~~~~~~~~~~~~~~^~~~~~~~~
lib/valueflow.cpp:8383:21: note: ‘intval’ was declared here
 8383 |     MathLib::bigint intval;
      |                     ^~~~~~

… build

```
lib/valueflow.cpp: In function ‘const Token* ValueFlow::solveExprValue(const Token*, const std::function<std::vector<long long int>(const Token*)>&, Value&)’:
lib/valueflow.cpp:8405:28: warning: ‘intval’ may be used uninitialized [-Wmaybe-uninitialized]
 8405 |             value.intvalue /= intval;
      |             ~~~~~~~~~~~~~~~^~~~~~~~~
lib/valueflow.cpp:8383:21: note: ‘intval’ was declared here
 8383 |     MathLib::bigint intval;
      |                     ^~~~~~
```
@firewave
Copy link
Collaborator Author

GCC is technically correct but the code using it will never be executed because of the logic involved.

@firewave firewave merged commit 3983c0c into danmar:main May 23, 2024
63 checks passed
@firewave firewave deleted the gcc-uninit branch May 23, 2024 16:18
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.

2 participants