Hello everyone!

Fedora just changed to gcc 15 in upcoming Fedora 42. And it seems dnsmasq is not able to compile [1][2] with the new compiler, like it could before. Example error is:

dhcp.c: In function ‘dhcp_packet’:
dhcp.c:320:49: error: passing argument 3 of ‘iface_enumerate’ from incompatible 
pointer type [-Wincompatible-pointer-types]
  320 |               !iface_enumerate(AF_INET, &match, check_listen_addrs) ||
      |                                                 ^~~~~~~~~~~~~~~~~~
      |                                                 |
      |                                                 int (*)(struct in_addr, 
 int,  char *, struct in_addr,  struct in_addr,  void *)

That is because the default compiler used -std version has changed to gnu23. There is a nice page with porting instructions for that version [3], which mentions full handler specification should be used before calling.

Our problem is iface_enumerate uses callbacks with different prototypes, depending on family passed to the function. It seems to me ideal change would be to make separate functions with just reused common parts. Because they have something in common, but are significantly different at the same time. It does not seem possible to have single prototype function callback for the current code.

I am not sending a patch yet, because I am not sure how exactly it should be changed. Of course temporary alternative would be explicitly using older -std=gnu17 in CFLAGS. But I think some other change should be made, but not yet sure what is should be.

Any opinions? Has anyone else hit already gcc 15 new issues?

Cheers,
Petr

1. https://bugzilla.redhat.com/show_bug.cgi?id=2340085
2. https://kojipkgs.fedoraproject.org//work/tasks/5223/127945223/build.log
3. https://gcc.gnu.org/gcc-15/porting_to.html#c23
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to