Skip to content
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

Fix a format specifier for size_t #7830

Merged
merged 1 commit into from
May 14, 2021
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 proxy/http/HttpSessionManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ ServerSessionPool::acquireSession(sockaddr const *addr, CryptoHash const &hostna
to_return = nullptr;

if ((TS_SERVER_SESSION_SHARING_MATCH_MASK_HOSTONLY & match_style) && !(TS_SERVER_SESSION_SHARING_MATCH_MASK_IP & match_style)) {
Debug("http_ss", "Search for host name only not IP. Pool size %" PRId64, m_fqdn_pool.count());
Debug("http_ss", "Search for host name only not IP. Pool size %zu", m_fqdn_pool.count());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the change be to "PRIu64'? Codes such as "zu" aren't portable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

HttpSessionManager.cc:150:79: error: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Werror,-Wformat]
    Debug("http_ss", "Search for host name only not IP.  Pool size %" PRIu64, m_fqdn_pool.count());
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
../../include/tscore/Diags.h:330:39: note: expanded from macro 'Debug'
      diags->log(tag, DL_Debug, &loc, __VA_ARGS__);    \
                                      ^~~~~~~~~~~

// This is broken out because only in this case do we check the host hash first. The range must be checked
// to verify an upstream that matches port and SNI name is selected. Walk backwards to select oldest.
in_port_t port = ats_ip_port_cast(addr);
Expand Down