[reSIProcate] Fixing signed/unsigned conflict in Socket.hxx
Eric Rescorla
ekr at networkresonance.com
Mon May 21 17:11:36 CDT 2007
On FreeBSD, I'm getting the following build error:
../../../build/../rutil/Socket.hxx: In member function `void resip::FdSet::setRead(resip::Socket)':
../../../build/../rutil/Socket.hxx:131: warning: comparison between signed and unsigned integer expressions
../../../build/../rutil/Socket.hxx: In member function `void resip::FdSet::setWrite(resip::Socket)':
../../../build/../rutil/Socket.hxx:140: warning: comparison between signed and unsigned integer expressions
../../../build/../rutil/Socket.hxx: In member function `void resip::FdSet::setExcept(resip::Socket)':
../../../build/../rutil/Socket.hxx:149: warning: comparison between signed and unsigned integer expressions
The problem is a comparison between Socket and FD_SETSIZE, which is
1024U on FreeBSD. The fix here seems to me to cast FD_SETSIZE to
(int) or (Socket) before doing the comparison. [Note that sockets
must always be signed because socket() may return -1.]
This only works on !Win32, but these asserts are !Win32 anyway.
Anyone object to my making this change?
-Ekr
More information about the resiprocate-devel
mailing list