[Dnsmasq-discuss] v2.91test1 compile failure on FreeBSD
Simon Kelley
simon at thekelleys.org.uk
Fri Dec 20 21:16:47 UTC 2024
On 12/20/24 12:27, Matthias Andree via Dnsmasq-discuss wrote:
> Simon,
>
> I cannot compile v2.91test1 on FreeBSD 14.2, errors below. (Neither
> tarball nor Git compile.) (2nd to last shown errors). Patch attached,
> should be fine with git-am.
Patch applied, thanks.
>
> Adding multiple unions with variable size into some other aggregate
> (union or struct) isn't portable, first shown warning below, might be an
> error on other or strictly set compilers. This needs fixing not covered
> by my patch.
If I've understood this right, then
https://thekelleys.org.uk/gitweb/?
p=dnsmasq.git;a=commit;h=4902807879c9b39db46c32e3e082a33266836d24
should fix it.
Cheers,
Simon.
>
>
> ./dnsmasq.h:1128:25: warning: field 'server' with variable sized type
> 'union all_addr' not at the end of a struct or class is a GNU extension
> [-Wgnu-variable-sized-type-not-at-end]
> 1128 | union all_addr local, server;
> | ^
> bpf.c:94:40: warning: incompatible pointer types passing 'struct in_addr
> *' to parameter of type 'char *' [-Wincompatible-pointer-types]
> 94 | if (!callback.af_unspec(AF_INET, &sin2->sin_addr,
> LLADDR(sdl), sdl->sdl_alen, parm))
> | ^~~~~~~~~~~~~~~
> bpf.c:103:5: error: conflicting types for 'iface_enumerate'
> 103 | int iface_enumerate(int family, void *parm, int (*callback)())
> | ^
> ./dnsmasq.h:1672:5: note: previous declaration is here
> 1672 | int iface_enumerate(int family, void *parm, callback_t callback);
> | ^
> bpf.c:110:41: error: member reference base type 'int (*)()' is not a
> structure or union
> 110 | return arp_enumerate(parm, callback.af_unspec);
> | ~~~~~~~~^~~~~~~~~~
> bpf.c:150:21: error: member reference base type 'int (*)()' is not a
> structure or union
> 150 | if (!callback.af_inet(addr, iface_index, NULL,
> netmask, broadcast, parm))
> | ~~~~~~~~^~~~~~~~
> bpf.c:215:21: error: member reference base type 'int (*)()' is not a
> structure or union
> 215 | if (!callback.af_inet6(addr, prefix, scope_id,
> iface_index, flags,
> | ~~~~~~~~^~~~~~~~~
> bpf.c:226:14: error: member reference base type 'int (*)()' is not a
> structure or union
> 226 | !callback.af_local(iface_index, ARPHRD_ETHER,
> LLADDR(sdl), sdl->sdl_alen, parm))
> | ~~~~~~~~^~~~~~~~~
> 9 warnings and 5 errors generated.
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
More information about the Dnsmasq-discuss
mailing list