tinyhttpd icon indicating copy to clipboard operation
tinyhttpd copied to clipboard

Compiler warning.

Open lv-zheng opened this issue 10 years ago • 1 comments

这个编译警告可以解决吗?

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,
            ^

lv-zheng avatar Aug 08 '15 07:08 lv-zheng

为啥我无法编译呢?我这儿编译出现了这个错误: impicture_20211222_210327

zhouxin1630 avatar Dec 22 '21 13:12 zhouxin1630