On 8/8/06, <b class="gmail_sendername">bob</b> <<a href="mailto:ican-rZHaEmXdJNJWk0Htik3J/w@public.gmane.org">ican-rZHaEmXdJNJWk0Htik3J/w@public.gmane.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In newer versions of the GCC compiler the block of C code:<br><br>int length;<br><br>...<br><br>if(getsockname(s, (struct sockaddr *)&sin, &length))<br><br>gives a warning below<br><br>socketUtils.c:259: warning: pointer targets in passing argument 3 of
<br>'getsockname' differ in signedness</blockquote><div><br>Hi Bob,<br><br>Google tells me at<br><br> <a href="http://www.penguin-soft.com/penguin/man/2/getsockname.html?manpath=/man/man2/getsockname.2.inc">http://www.penguin-soft.com/penguin/man/2/getsockname.html?manpath=/man/man2/getsockname.2.inc
</a><br><br>that getsockname has the following prototype:<br><br> int getsockname(int s , struct sockaddr * name , socklen_t * namelen );<br><br>so you need to cast length to a pointer to socklen_t, even if that works out to an int in the end. Change your line to
<br><br> if(getsockname(s, (struct sockaddr *)&sin, (socklen_t *)&length))<br><br>and re-compile. Let us know how it all works.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I tracked it down to a define called "socklen_t". Damned if I can find<br>where that is defined.</blockquote><div><br>Google is your friend. :)<br><br></div></div>-- <br>Alex Beamish<br>Toronto, Ontario<br>