1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

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');
                                       ~~~~~~~~~^~~~~~~~~~~
This commit is contained in:
marxin
2019-04-02 13:46:35 +02:00
parent 21e2419e24
commit cdf54d6c5f
3 changed files with 14 additions and 3 deletions

View File

@@ -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())) {