site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On May 16, 2005, at 2:39 PM, Ryan Lum wrote: First, though I was getting strange compiler warnings. 1789: getsockname(s, (struct sockaddr *)&isa, &i); 1804: t = accept(s, (struct sockaddr *)&isa, &i); 1863: rc = getpeername(desc, (struct sockaddr *) &sock, &size); I fixed the warnings by making (i) an unsigned int. The bind code I am having a problem with is: if(bind(s, (struct sockaddr *)&sa, sizeof(sa) < 0)) { When you get -1 as the return value, what is errno set to? -josh _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com I have some code that is over 10 years old. With the recent change to GCC 4.0 my socket code won't compile anymore. The only way I can compile my code is if I use gcc_select. The problem is with the bind() call. comm.c: In function 'co1900_new_connection': comm.c:1798: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness comm.c:1804: warning: pointer targets in passing argument 3 of 'accept' differ in signedness comm.c: In function 'co2000_new_descriptor': comm.c:1863: warning: pointer targets in passing argument 3 of 'getpeername' differ in signedness With gcc 3.3 no problems, but it is returning -1 with 4.0. I am no socket expert, and any debugging advice would help. smime.p7s
participants (1)
-
Josh Graessley