bsd sockets and gcc 4.0 not all happy in Tiger - MacRumors Forums
Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 14, 2005, 10:08 PM   #1
superbovine
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
bsd sockets and gcc 4.0 not all happy in Tiger

I have a project the crossed developed on os x and linux using gcc. Up till gcc 3.3 everything was fine and happy. When tiger came along with gcc 4.0 i started getting weird warnings, and the software has runtime errors with sockets. I have been using gcc_select to get by.

With gcc 4.0 get these build errors.

Code:
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
Code:
1789: 	getsockname(s, (struct sockaddr *)&isa, &i);
1804:    t = accept(s, (struct sockaddr *)&isa, &i);
1863:    rc = getpeername(desc, (struct sockaddr *) &sock, &size);
I know that this is limited information but any ideas as of to why gcc 4.0 doesn't like this lines well help.

Also in a seperate project under the same situation happened with gcc 4.0 vs gcc 3.3 and bsd sockets.

Code:
gcc -c -g -O2 -Wall -DCIRCLE_IPV6 comm.c
In file included from sysdep.h:268,
from comm.c:14:
/usr/include/sys/socket.h:99: error: two or more data types in declaration specifiers
superbovine is offline   0 Reply With Quote
Old May 15, 2005, 09:24 PM   #2
broken_keyboard
Banned
 
broken_keyboard's Avatar
 
Join Date: Apr 2004
Location: Secret Moon base
Try changing your declaration of i from "int i" to "unsigned int i"

It is complaining that you are passing a pointer to a signed type when the prototype requires unsigned (or vise versa).
broken_keyboard is offline   0 Reply With Quote
Old May 16, 2005, 05:08 AM   #3
superbovine
Thread Starter
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
Quote:
Originally Posted by broken_keyboard
Try changing your declaration of i from "int i" to "unsigned int i"

It is complaining that you are passing a pointer to a signed type when the prototype requires unsigned (or vise versa).
thanks that helped a lot. i have problem narrowed down to bind() now.
superbovine is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
nMP - question about TB2 sockets reliability 2128506 Mac Pro 49 Jan 19, 2014 09:53 PM
Where is my gcc and g++ compiler sysProgrammer Mac Programming 10 Nov 24, 2013 06:47 PM
BSD on Mac: No Boot wrldwzrd89 Windows, Linux & Others on the Mac 1 Nov 11, 2013 11:30 AM
mbpro charger plug for alternate sockets zoran Mac Peripherals 3 Sep 1, 2013 11:31 AM
Divert sockets blazerguns Mac Programming 2 Feb 16, 2013 01:31 PM

Forum Jump

All times are GMT -5. The time now is 07:04 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC