-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C++: exclude uninitialized uses inside pure expression statements #13647
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
Conversation
890f8b9 to
5b1f118
Compare
|
This will still need some tests to show that only |
| @@ -0,0 +1,4 @@ | |||
| --- | |||
| category: majorAnalysis | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| category: majorAnalysis | |
| category: minorAnalysis |
I don't think this warrants a majorAnalysis tag. A majorAnalysis change bumps the minor version-number, which I think is a bit too much for this change.
This eliminates FPs caused by casting a variable explicitly to void type. Developers use this cast to suppress compiler warnings on unused variables, e.g. (void) x;
|
@jketema
codeql/cpp/ql/lib/semmle/code/cpp/commons/VoidContext.qll Lines 14 to 22 in 139585f
However, as stated in the above comment,
Thus the existing query will treat |
5b1f118 to
4b4c0cd
Compare
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your contribution!
This eliminates FPs such as casting a variable explicitly to void type. E.g.
Developers use this cast to supress compiler warnings on unused variables.