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

Fix incompatible pointer to integer conversion initializing #110

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

Conversation

listout
Copy link

@listout listout commented Sep 24, 2023

Makes struct members explicit.

First found on Gentoo linux, with MUSL LLVM profile. Most probably due to newer compilers (like Clang 16 and GCC 14) have turned various errors on by default and we get build errors such as:

net.c:115:79: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
        struct msghdr           s_msg = { (void *)&s_sa, sizeof(struct sockaddr_nl), s_io, 1, NULL, 0, 0};
                                                                                              ^~~~
/usr/include/unistd.h:25:14: note: expanded from macro 'NULL'
             ^~~~~~~~~~
net.c:121:79: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
        struct msghdr           r_msg = { (void *)&r_sa, sizeof(struct sockaddr_nl), r_io, 1, NULL, 0, 0};
                                                                                              ^~~~
/usr/include/unistd.h:25:14: note: expanded from macro 'NULL'

Bug: https://bugs.gentoo.org/897840

Makes struct members explicit.

First found on Gentoo linux, with MUSL LLVM profile. Most probably due
to newer compilers (like Clang 16 and GCC 14) have turned various errors
on by default and we get build errors such as:

```
net.c:115:79: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
        struct msghdr           s_msg = { (void *)&s_sa, sizeof(struct sockaddr_nl), s_io, 1, NULL, 0, 0};
                                                                                              ^~~~
/usr/include/unistd.h:25:14: note: expanded from macro 'NULL'
             ^~~~~~~~~~
net.c:121:79: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
        struct msghdr           r_msg = { (void *)&r_sa, sizeof(struct sockaddr_nl), r_io, 1, NULL, 0, 0};
                                                                                              ^~~~
/usr/include/unistd.h:25:14: note: expanded from macro 'NULL'
```

Bug: https://bugs.gentoo.org/897840
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant