Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iocore/net/OCSPStapling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ stapling_get_issuer(SSL_CTX *ssl_ctx, X509 *x)
goto end;
}

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

issuer = sk_X509_value(extra_certs, i);
if (X509_check_issued(issuer, x) == X509_V_OK) {
#if OPENSSL_VERSION_NUMBER < 0x10100000
Expand Down