help needed
Florian Weimer
fw@deneb.enyo.de
Sat Oct 13 01:41:00 GMT 2001
ram <gangadhar@applabs.net> writes:
> itfrecv.c: In function `ack_funct':
> itfrecv.c:389: too few arguments to function `send'
> itfrecv.c: In function `errlog':
> itfrecv.c:422: warning: passing arg 3 of `write' makes integer from pointer
> without a cast
>
> the lines are as below
>
> 389 send(sockfd, buffer, strlen(buffer));
> 422 write(fd, buffer, index);
>
> what should I change to make the program compile with gcc.
The send(2) function on GNU/Linux takes four parameters, not three
(see the manual). However, it is possible that your program defines
its own send() function, in this case you would have to rename it.
The warning seems to indicate a genuine bug in the code: It doesn't
make much sense to pass a pointer value as a byte count to write(2).
(These problems are not related to GCC, you should probably ask in a
more appropriate forum such as comp.os.linux.development.apps.)
More information about the Gcc-help
mailing list