[Dnsmasq-discuss] Three v2.92test8 findings (one regression from d1008215 made 2025 May 14)

Matthias Andree matthias.andree at gmx.de
Mon May 19 23:30:48 UTC 2025


Am 19.05.25 um 21:56 schrieb Simon Kelley:
>> [...]

>> I don't oversee enough of the code to judge whether the 
>> first-16bits-of- packet-in-network-order != OP_RRQ is relevant here. 
>> If it's from the network, of course any garbage can be in there and 
>> kick the reporting in lines 370ff off balance.
>>
>> What do you think?
>
> Clang is right, gcc missed a trick. re-ordering the tests make it 
> sensible, as far as I can see. Fixed in
>
> https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=baf3c57af5d432a8239f7c28c414aa41d95a1bb6 
>
Thanks, fix confirmed (in the form of compiling v2.92test9) on the same 
computer and with the same clang compiler that complained about v2.92test8.
>> finding #2, the attached patch fixes a warning about an unused static 
>> function:
>>
>> forward.c:673:23:warning: 'domain_find_sets' defined but not used [- 
>> Wunused-function]
>>   673 | static struct ipsets *domain_find_sets(struct ipsets 
>> *setlist, const char *domain) {
>>       | ^~~~~~~~~~~~~~~~
>>
>>
> Not a problem, but certainly noise. Also fixed in the same commit. 
> There are a few more of these around, that generate spurious unused 
> variable/function warnings when certain compile-time settings are in 
> effect. It would be nice to fix them so there's no warnings when I run 
> my "compile dnsmasq with every sane combination of 
> compile-time-options" script. To reach that state, I'd also have to 
> fix the ubus header files :-(

Certainly not a problem, and I appreciate that variant/profile 
management isn't lightweight.

>>> edns0.c:In function 'add_umbrella_opt':
>>> edns0.c:512:30:warning: initializer-string for array of 'unsigned 
>>> char' truncates NUL terminator but destination lacks 'nonstring' 
>>> attribute (5 chars into 4 available) [-Wunterminated-string- 
>>> initialization]
>>>  512 |   struct umbrella_opt opt = {{"ODNS"}, UMBRELLA_VERSION, 0, 
>>> {0}};
>>>      | ^
>>
>
> It seems reasonable code to me too, and a any fix would be much more 
> ugly. Ignoring.

Agreed.

(For production release packaging in FreeBSD we can disable a few 
warnings with, say, -Wno-unused-function.)


Thank you very much!

Kind regards,
Matthias




More information about the Dnsmasq-discuss mailing list