[Dnsmasq-discuss] iface_enumerate does not compile with gcc 15

Petr Menšík pemensik at redhat.com
Thu Jan 23 12:35:42 UTC 2025


Ah, great! I did not look back enough into history it seems.

On 23. 01. 25 13:19, Nicolas Cavallari wrote:
> On 23/01/2025 12:29, Petr Menšík wrote:
>> 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?
>
> This was supposed to be fixed by 
> https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2024q4/017855.html
>
> Simon says it was applied but I do not see this patch in git.
>




More information about the Dnsmasq-discuss mailing list