-
Notifications
You must be signed in to change notification settings - Fork 12
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
Codechange: Silence clang warnings about va_start #30
Conversation
dafebdd
to
cd586bc
Compare
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.
Not sure I really like this construction.
On the other hand, the alternatives are much more invasive... although maybe consider swapping minSan
and id
in IssueMessage
and something similar in CheckLength
could help, but that means touching a lot of the code base, making this solution slightly more palatable from a review point of view.
After reading the comment about swapping parameters I tried something in master...glx22:grfcodec:clang-warnings-2. |
I'm not fond of this approach because it's attempting to avoid the actual reorder, causing similar functions with different parameter order, which might cause further trouble later on. Though I can also imaging that it's going to cause a lot of churn given the number of |
Yeah I count 15 CheckLength() calls, 465 IssueMessage() calls, and 3 vIssueMessage() calls. So yeah, a global reorder doesn't seem the be a good idea. |
Now I have a third version in master...glx22:grfcodec:clang-warnings-3. |
I guess the -2 version is the least bad solution. I do not have any other ideas that would be relatively non-intrusive to solve these warnings. |
Hmm maybe a mix of this PR and -2, without |
cd586bc
to
29f0561
Compare
29f0561
to
6e588fd
Compare
Fixes
passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]