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

Update STUNExternalIP.c #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aanousakis
Copy link

STUNExternalIP.c: In function 'getPublicIPAddress':
STUNExternalIP.c:195:12: error: variable 'tv' has initializer but incomplete type
struct timeval tv = {5, 0};
^~~~~~~
STUNExternalIP.c:195:26: warning: excess elements in struct initializer
struct timeval tv = {5, 0};
^
STUNExternalIP.c:195:26: note: (near initialization for 'tv')
STUNExternalIP.c:195:29: warning: excess elements in struct initializer
struct timeval tv = {5, 0};
^
STUNExternalIP.c:195:29: note: (near initialization for 'tv')
STUNExternalIP.c:195:20: error: storage size of 'tv' isn't known
struct timeval tv = {5, 0};
^~
STUNExternalIP.c:197:62: error: invalid application of 'sizeof' to incomplete type 'struct timeval'
setsockopt(socketd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval));
^~~~~~
make: *** [: STUNExternalIP.o] Error 1

Compiling the code in alpine linux produces the above error. Including sys/time.h solves it.

STUNExternalIP.c: In function 'getPublicIPAddress':
STUNExternalIP.c:195:12: error: variable 'tv' has initializer but incomplete type
     struct timeval tv = {5, 0};
            ^~~~~~~
STUNExternalIP.c:195:26: warning: excess elements in struct initializer
     struct timeval tv = {5, 0};
                          ^
STUNExternalIP.c:195:26: note: (near initialization for 'tv')
STUNExternalIP.c:195:29: warning: excess elements in struct initializer
     struct timeval tv = {5, 0};
                             ^
STUNExternalIP.c:195:29: note: (near initialization for 'tv')
STUNExternalIP.c:195:20: error: storage size of 'tv' isn't known
     struct timeval tv = {5, 0};
                    ^~
STUNExternalIP.c:197:62: error: invalid application of 'sizeof' to incomplete type 'struct timeval'
     setsockopt(socketd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval));
                                                              ^~~~~~
make: *** [<builtin>: STUNExternalIP.o] Error 1


Compiling the code in alpine linux produces the above error. Including sys/time.h solves it.
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 this pull request may close these issues.

1 participant