-
Notifications
You must be signed in to change notification settings - Fork 198
Cleaning up Clang --warnlevel=1 warnings (reported in #23) #1419
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| client->req_len = req.length = 1; | ||
| REQUEST_FIXED_SIZE(req, SIZE_MAX); | ||
| REQUEST_FIXED_SIZE(req, UINT_MAX); |
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.
@metux is this right?
Doesn't this test what happens on overflow?
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.
indeed looks so.
There's no need to create new PRs after rebase - you can use forced push (git push +) |
Closing the old PR was not intentional; I renamed the branch without realizing that it would close the pull request. |
By "renaming" you mean pushing as a new one and deleting the old one ? |
Yeah. It was accidental. Everything should be good now |
Bit-shifting a negative integer leads to undefined behavior. Fixed by negating the entire bitshift operation, rather than bitshifting a negative value. This fixes one of the Clang warnings as mentioned in X11Libre#23. Signed-off-by: Spxctre <[email protected]>
…ned int` to `SIZE_MAX` `SIZE_MAX` is out of the range of `client->req_len` (unsigned int). Compare `client->req_len` to `UINT_MAX` instead. This fixes one of the Clang warnings as mentioned in X11Libre#23. Signed-off-by: Spxctre <[email protected]>
…hile body The `SYSCALL` macro can seldom generate a warning in Clang when used immediately before another macro (e.g. `DebugF`). We can explicitly define the empty body to suppress these warnings. Signed-off-by: Spxctre <[email protected]>
#1406
Rebased from
master. First time contributor so I'm not really sure exactly how y'all want this, hopefully this is fine.