Skip to content

Conversation

@maskit
Copy link
Member

@maskit maskit commented Mar 15, 2023

Same as code below:

// BoringSSL has sk_X509_num() return size_t.
for (int i = 0; i < static_cast<int>(sk_X509_num(chain)) && !retval; i++) {

@maskit maskit added Build work related to build configuration or environment TLS labels Mar 15, 2023
@maskit maskit added this to the 10.0.0 milestone Mar 15, 2023
@maskit maskit self-assigned this Mar 15, 2023
}

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++) {
Copy link
Member

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 ; ...

Copy link
Member Author

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?

Copy link
Member

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

@maskit
Copy link
Member Author

maskit commented Mar 16, 2023

[approve ci freebsd]

@maskit maskit merged commit 0bd8816 into apache:master Mar 16, 2023
zwoop pushed a commit that referenced this pull request Mar 16, 2023
@zwoop
Copy link
Contributor

zwoop commented Mar 16, 2023

Cherry-picked to v9.2.x

@zwoop zwoop modified the milestones: 10.0.0, 9.2.1 Mar 16, 2023
masaori335 pushed a commit to masaori335/trafficserver that referenced this pull request Jul 24, 2023
* 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>
masaori335 pushed a commit to masaori335/trafficserver that referenced this pull request Jul 24, 2023
(cherry picked from commit 0bd8816)
(cherry picked from commit c31b062)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build work related to build configuration or environment TLS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants