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

-Wincompatible-pointer-types error in init.c, if gcc version >= 14 #59

Open
akira-kurogane opened this issue Aug 7, 2024 · 0 comments · May be fixed by #60
Open

-Wincompatible-pointer-types error in init.c, if gcc version >= 14 #59

akira-kurogane opened this issue Aug 7, 2024 · 0 comments · May be fixed by #60

Comments

@akira-kurogane
Copy link

When remaking my lwip-using unikernel on a new computer the build terminated on this error:

/home/akira/avar_src/app-mongod403/w/libs/lwip/init.c: In function ‘liblwip_init’:
/home/akira/avar_src/app-mongod403/w/libs/lwip/init.c:402:58: error: passing argument 2 of ‘dns_setserver’ from incompatible pointer type [-Wincompatible-pointer-types]
  402 |                                 dns_setserver(nb_dns4++, &dns4);
      |                                                          ^~~~~
      |                                                          |
      |                                                          ip4_addr_t * {aka struct ip4_addr *}

It appears that gcc version >= 14 will make -Wincompatible-pointer-types an error instead of warning by default: https://gcc.gnu.org/gcc-14/porting_to.html

My workaround for now is simply to add -Wno-incompatible-pointer-types (or -Wno-error=incompatible-pointer-types?) to the LIBLWIP_CFLAGS line in lwip's Makefile.uk.

cluosh added a commit to cluosh/lib-lwip that referenced this issue Dec 8, 2024
The invalid pointer warning becomes an error in gcc14, and it turns out
it's actually an invalid pointer, because it expects a pointer to a
struct with a type tag and not just the IPv4 address.
@razvand razvand linked a pull request Dec 8, 2024 that will close this issue
cluosh added a commit to cluosh/lib-lwip that referenced this issue Dec 8, 2024
The invalid pointer warning becomes an error in gcc14, and it turns out
it's actually an invalid pointer, because it expects a pointer to a
struct with a type tag and not just the IPv4 address, if we have IPv4
and IPv6 enabled (otherwise it typedefs to the IPv4 address and
everything is fine).
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.

1 participant