tinyhttpd
tinyhttpd copied to clipboard
Compiler warning.
这个编译警告可以解决吗?
gcc -W -Wall -lpthread -o httpd httpd.c
httpd.c: In function ‘startup’:
httpd.c:533:52: warning: pointer targets in passing argument 3 of ‘getsockname’ differ in signedness [-Wpointer-sign]
if (getsockname(httpd, (struct sockaddr *)&name, &namelen) == -1)
^
In file included from httpd.c:23:0:
/usr/include/sys/socket.h:127:12: note: expected ‘socklen_t * restrict {aka unsigned int * restrict}’ but argument is of type ‘int *’
extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
^
httpd.c: In function ‘main’:
httpd.c:591:24: warning: pointer targets in passing argument 3 of ‘accept’ differ in signedness [-Wpointer-sign]
&client_name_len);
^
In file included from httpd.c:23:0:
/usr/include/sys/socket.h:243:12: note: expected ‘socklen_t * restrict {aka unsigned int * restrict}’ but argument is of type ‘int *’
extern int accept (int __fd, __SOCKADDR_ARG __addr,
^
为啥我无法编译呢?我这儿编译出现了这个错误:
