summaryrefslogtreecommitdiff
path: root/drivers/unix/net_socket_posix.cpp
diff options
context:
space:
mode:
authormarxin <mliska@suse.cz>2019-04-02 13:46:35 +0200
committermarxin <mliska@suse.cz>2019-05-02 11:11:52 +0200
commitcdf54d6c5fcaf20088cc334a9973cdd435041bc3 (patch)
treecc5166d62981bb89581e9f6d1f2a7ec9173be3ea /drivers/unix/net_socket_posix.cpp
parent21e2419e24b9b868fe5da2735784f31366bd1629 (diff)
Ignore a warning in _get_socket_error (-Wlogical-op).
drivers/unix/net_socket_posix.cpp: In member function 'NetSocketPosix::NetError NetSocketPosix::_get_socket_error()': drivers/unix/net_socket_posix.cpp:197:22: warning: logical 'or' of equal expressions [-Wlogical-op] 197 | if (errno == EAGAIN || errno == EWOULDBLOCK) | ^ and: modules/mono/utils/string_utils.cpp: In function 'int {anonymous}::sfind(const String&, int)': modules/mono/utils/string_utils.cpp:68:48: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] found = src[read_pos] == 's' || (c >= '0' || c <= '4'); ~~~~~~~~~^~~~~~~~~~~
Diffstat (limited to 'drivers/unix/net_socket_posix.cpp')
-rw-r--r--drivers/unix/net_socket_posix.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp
index 2dffa083fe..37abccbe27 100644
--- a/drivers/unix/net_socket_posix.cpp
+++ b/drivers/unix/net_socket_posix.cpp
@@ -177,6 +177,13 @@ NetSocketPosix::~NetSocketPosix() {
close();
}
+// Silent a warning reported in #27594
+
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlogical-op"
+#endif
+
NetSocketPosix::NetError NetSocketPosix::_get_socket_error() {
#if defined(WINDOWS_ENABLED)
int err = WSAGetLastError();
@@ -201,6 +208,10 @@ NetSocketPosix::NetError NetSocketPosix::_get_socket_error() {
#endif
}
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
bool NetSocketPosix::_can_use_ip(const IP_Address p_ip, const bool p_for_bind) const {
if (p_for_bind && !(p_ip.is_valid() || p_ip.is_wildcard())) {