-
Notifications
You must be signed in to change notification settings - Fork 845
Fix compile warning on BoringSSL build #9525
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
| } | ||
|
|
||
| for (int i = 0; i < sk_X509_num(extra_certs); i++) { | ||
| for (int i = 0; i < static_cast<int>(sk_X509_num(extra_certs)); i++) { |
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.
Why cast, rather than changing int to the correct type? If you wanted to annoying Leif, you could even do
for ( decltype(sk_X509_num(extra_certs) i = 0 ; ...
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.
https://godbolt.org/z/GPTGacGGc
You like to do things in inconsistent ways?
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.
No, decltype was added to deal with this kind of situation.
Example on godbolt
|
[approve ci freebsd] |
(cherry picked from commit 0bd8816)
|
Cherry-picked to v9.2.x |
* Slight performance improvements before calling APIHooks::clear (apache#9480) (cherry picked from commit c54a2e2) (cherry picked from commit 782fbfd) * Fix compile warning on BoringSSL build (apache#9525) (cherry picked from commit 0bd8816) (cherry picked from commit c31b062) Co-authored-by: Leif Hedstrom <zwoop@apache.org> Co-authored-by: Masakazu Kitajo <maskit@apache.org>
Same as code below:
trafficserver/tests/tools/plugins/ssl_client_verify_test.cc
Lines 116 to 117 in c54a2e2