Code:
if (bind(sockfd, (sockaddr *) &addr, sizeof(addr)) == -1) {
Error:
fs_server.cpp:264:56: error: invalid operands to binary expression ('__bind<int &, sockaddr *,
unsigned long>' and 'int')
if (bind(sockfd, (sockaddr *) &addr, sizeof(addr)) == -1) {
This was working when I run this code using C++11, and also works when I run this code using C++ 17 on Linux. It does not work when I run it on Mac OS using C++17. To me, it looks like the error indicates that the comparison is between the function itself and -1. I'm not sure why this would happen. Am I interpreting something incorrectly?