Skip to content

Commit 08b511c

Browse files
author
King_DuckZ
committed
Warning fix on gcc 9.3.0 with logging disabled
1 parent 48bc608 commit 08b511c

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

include/restc-cpp/restc-cpp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class Request {
145145
class Properties {
146146
public:
147147
using ptr_t = std::shared_ptr<Properties>;
148-
using redirect_fn_t = std::function<void (int code, std::string& url,
148+
using redirect_fn_t = std::function<void (int code, std::string& url,
149149
const Reply& reply)>;
150150

151151
int maxRedirects = 3;
@@ -382,7 +382,7 @@ class RestClient {
382382
done_handler.reset();
383383
});
384384

385-
return move(future);
385+
return future;
386386
}
387387

388388

src/ChunkedReaderImpl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,15 @@ class ChunkedReaderImpl : public DataReader {
4646
}
4747

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

54+
#if __cplusplus < 201703L
55+
static_cast<void>(buf_len);
56+
#endif
57+
5158
// At the time of the implementation, there are never multiple buffers.
5259
RESTC_CPP_LOG_TRACE_(tag << ' ' << "# " << buf_len
5360
<< " bytes: "

src/IoWriterImpl.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ class IoWriterImpl : public DataWriter {
3333
connection_->GetSocket().AsyncWrite(buffers, ctx_.GetYield());
3434
}
3535

36-
const auto bytes = boost::asio::buffer_size(buffers);
37-
38-
RESTC_CPP_LOG_TRACE_("Wrote #" << bytes
36+
RESTC_CPP_LOG_TRACE_("Wrote #" << boost::asio::buffer_size(buffers)
3937
<< " bytes to " << connection_);
4038
}
4139

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

52-
const auto bytes = boost::asio::buffer_size(buffers);
53-
54-
RESTC_CPP_LOG_TRACE_("Wrote #" << bytes
50+
RESTC_CPP_LOG_TRACE_("Wrote #" << boost::asio::buffer_size(buffers)
5551
<< " bytes to " << connection_);
5652
}
5753

0 commit comments

Comments
 (0)