Re: [reSIProcate] Fixing signed/unsigned conflict in Socket.hxx
- From: "Alfred E. Heggestad" <aeh@xxxxxx>
- Date: Tue, 22 May 2007 11:02:10 +0200
Eric Rescorla wrote:
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?
I have also reported this warnings a couple of weeks ago, and I would be very
grateful if you make the change to fix this.
/alfred
-Ekr
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel