Skip to content

Warning fix on gcc 9.3.0 with logging disabled #100

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions include/restc-cpp/restc-cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class Request {
class Properties {
public:
using ptr_t = std::shared_ptr<Properties>;
using redirect_fn_t = std::function<void (int code, std::string& url,
using redirect_fn_t = std::function<void (int code, std::string& url,
const Reply& reply)>;

int maxRedirects = 3;
Expand Down Expand Up @@ -382,7 +382,7 @@ class RestClient {
done_handler.reset();
});

return move(future);
return future;
}


Expand Down
7 changes: 7 additions & 0 deletions src/ChunkedReaderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@ class ChunkedReaderImpl : public DataReader {
}

void Log(const boost::asio::const_buffers_1 buffers, const char *tag) {
#if __cplusplus >= 201703L
[[maybe_unused]]
#endif
const auto buf_len = boost::asio::buffer_size(*buffers.begin());

#if __cplusplus < 201703L
static_cast<void>(buf_len);
#endif

// At the time of the implementation, there are never multiple buffers.
RESTC_CPP_LOG_TRACE_(tag << ' ' << "# " << buf_len
<< " bytes: "
Expand Down
8 changes: 2 additions & 6 deletions src/IoWriterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ class IoWriterImpl : public DataWriter {
connection_->GetSocket().AsyncWrite(buffers, ctx_.GetYield());
}

const auto bytes = boost::asio::buffer_size(buffers);

RESTC_CPP_LOG_TRACE_("Wrote #" << bytes
RESTC_CPP_LOG_TRACE_("Wrote #" << boost::asio::buffer_size(buffers)
<< " bytes to " << connection_);
}

Expand All @@ -49,9 +47,7 @@ class IoWriterImpl : public DataWriter {
connection_->GetSocket().AsyncWrite(buffers, ctx_.GetYield());
}

const auto bytes = boost::asio::buffer_size(buffers);

RESTC_CPP_LOG_TRACE_("Wrote #" << bytes
RESTC_CPP_LOG_TRACE_("Wrote #" << boost::asio::buffer_size(buffers)
<< " bytes to " << connection_);
}

Expand Down