<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello everyone!</p>
<p>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:</p>
<pre>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 *)</pre>
<p></p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>Any opinions? Has anyone else hit already gcc 15 new issues?</p>
<p>Cheers,<br>
Petr<br>
</p>
<p>1. <a class="moz-txt-link-freetext" href="https://bugzilla.redhat.com/show_bug.cgi?id=2340085">https://bugzilla.redhat.com/show_bug.cgi?id=2340085</a><br>
2.
<a class="moz-txt-link-freetext" href="https://kojipkgs.fedoraproject.org//work/tasks/5223/127945223/build.log">https://kojipkgs.fedoraproject.org//work/tasks/5223/127945223/build.log</a><br>
3. <a class="moz-txt-link-freetext" href="https://gcc.gnu.org/gcc-15/porting_to.html#c23">https://gcc.gnu.org/gcc-15/porting_to.html#c23</a><br>
</p>
</body>
</html>