From 22bb731041da2e077498372982777f648cf22d6c Mon Sep 17 00:00:00 2001 From: lihuiba Date: Thu, 28 Mar 2024 11:24:59 +0800 Subject: [PATCH] fix gcc13 --- common/iovector.h | 5 +++++ net/datagram_socket.h | 2 ++ rpc/rpc.cpp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/common/iovector.h b/common/iovector.h index 97d583d4..2dc11f0f 100644 --- a/common/iovector.h +++ b/common/iovector.h @@ -39,6 +39,10 @@ limitations under the License. #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-warning-option" +#pragma GCC diagnostic ignored "-Wzero-length-bounds" + inline bool operator == (const iovec& a, const iovec& b) { return a.iov_base == b.iov_base && a.iov_len == b.iov_len; @@ -1074,3 +1078,4 @@ class SmartCloneIOV #undef IF_ASSERT_RETURN +#pragma GCC diagnostic pop \ No newline at end of file diff --git a/net/datagram_socket.h b/net/datagram_socket.h index a7dbfc28..d9284467 100644 --- a/net/datagram_socket.h +++ b/net/datagram_socket.h @@ -50,6 +50,8 @@ class IDatagramSocket : public IMessage, ssize_t recv(B* buf, S count, int flags = 0) { return cast()->recv(buf, count, nullptr, nullptr, flags); } + using IMessage::recv; + using IMessage::send; }; class UDPSocket : public IDatagramSocket { diff --git a/rpc/rpc.cpp b/rpc/rpc.cpp index d55a778e..0fc401dc 100644 --- a/rpc/rpc.cpp +++ b/rpc/rpc.cpp @@ -324,8 +324,12 @@ namespace rpc { if (unlikely(!m_running)) return -1; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-warning-option" +#pragma GCC diagnostic ignored "-Wdangling-pointer" ThreadLink node; m_list.push_back(&node); +#pragma GCC diagnostic pop DEFER(m_list.erase(&node)); // stream serve refcount int stream_serv_count = 0;