src/arch/linux/net_socket.cpp:171:16: error: ordered comparison of pointer with integer zero (‘const char*’ and ‘int’)
171 | return ans <= 0 ? RESULT_OPERATION_FAIL : RESULT_OK;
u_result SocketAddress::setAddressFromString(const char address_string, SocketAddress::address_type_t type)
{
int ans = 0;
int prevPort = getPort();
switch (type) {
case ADDRESS_TYPE_INET:
reinterpret_cast<sockaddr_storage >(_platform_data)->ss_family = AF_INET;
ans = inet_pton(AF_INET,
address_string,
&reinterpret_cast<sockaddr_in *>(_platform_data)->sin_addr);
break;
case ADDRESS_TYPE_INET6:
reinterpret_cast<sockaddr_storage *>(_platform_data)->ss_family = AF_INET6;
ans = inet_pton(AF_INET6,
address_string,
&reinterpret_cast<sockaddr_in6 *>(_platform_data)->sin6_addr);
break;
default:
return RESULT_INVALID_DATA;
}
setPort(prevPort);
return ans <= 0 ? RESULT_INVALID_DATA : RESULT_OK;
}
When compiling on ubuntu the above error occurs in compilation from the above function.
src/arch/linux/net_socket.cpp:171:16: error: ordered comparison of pointer with integer zero (‘const char*’ and ‘int’) 171 | return ans <= 0 ? RESULT_OPERATION_FAIL : RESULT_OK;
u_result SocketAddress::setAddressFromString(const char address_string, SocketAddress::address_type_t type) { int ans = 0; int prevPort = getPort(); switch (type) { case ADDRESS_TYPE_INET: reinterpret_cast<sockaddr_storage >(_platform_data)->ss_family = AF_INET; ans = inet_pton(AF_INET, address_string, &reinterpret_cast<sockaddr_in *>(_platform_data)->sin_addr); break;
}
When compiling on ubuntu the above error occurs in compilation from the above function.