Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warning. #1

Open
lv-zheng opened this issue Aug 8, 2015 · 1 comment · May be fixed by #2
Open

Compiler warning. #1

lv-zheng opened this issue Aug 8, 2015 · 1 comment · May be fixed by #2

Comments

@lv-zheng
Copy link

lv-zheng commented Aug 8, 2015

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

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 lv-zheng linked a pull request Aug 8, 2015 that will close this issue
@zhouxin1630
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants