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

inet_ntop() -- error: argument 'size' doesn't match prototype #2

Open
rahulrajaram opened this issue Dec 16, 2018 · 1 comment
Open

Comments

@rahulrajaram
Copy link

Hi,

Thanks for hosting this project. I have found a problem in the following step.

cd libfree
make

It looks like this definition of inet_ntop conflicts with the prototype here. Specifically, the fourth parameter, size, which is of type size_t in libfree/inet_ntop.c, should actually be socklen_t.

I have verified that libfree/ complies after making the change.

Thanks,
Rahul.

@MagicZer0
Copy link

Hi,
Also have i found that problem, but how to solve them?
What's more, after i've changed the type of parameter size to socklen_t, there are other problems, uninitialized variable before used.

gcc -I../lib -g -O2 -D_REENTRANT -Wall   -c -o inet_ntop.o inet_ntop.c
/usr/include/arpa/inet.h: In function ‘inet_ntop’:
inet_ntop.c:153:23: warning: ‘best.len’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (best.base == -1 || cur.len > best.len)
       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
inet_ntop.c:124:28: note: ‘best.len’ was declared here
  struct { int base, len; } best, cur;
                            ^~~~
gcc -I../lib -g -O2 -D_REENTRANT -Wall   -c -o inet_pton.o inet_pton.c
ar rv ../libunp.a in_cksum.o inet_ntop.o inet_pton.o
a - in_cksum.o
a - inet_ntop.o
a - inet_pton.o
ranlib ../libunp.a

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

No branches or pull requests

2 participants