From: John Thacker Date: Sun, 12 Oct 2025 18:53:49 +0000 (-0400) Subject: wireshark-pidl: Reduce false positive warnings when compiling X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7011429284dac61406eaabea90eee4f59a078178;p=thirdparty%2Fsamba.git wireshark-pidl: Reduce false positive warnings when compiling From the Wireshark git repository, to reduce false positive warnings when compiling dissectors with pidl: commit 919f15ab2ea313d69cc2578426430f22f65a51b5 Author: John Thacker Date: Wed Oct 8 16:52:09 2025 -0400 pidl: Don't warn about params that are used The "USED" indicator is never set for params, which results in many bogus "warning: dissector param never used" messages when compiling the pidl dissectors. Set it when used, to reduce the number of messages. Signed-off-by: John Thacker Reviewed-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 3d8b74bab45..78320e8d093 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -389,13 +389,19 @@ sub ElementLevel($$$$$$$$) $t = $l->{DATA_TYPE}; } + if ($param ne 0) { + $self->{conformance}->{dissectorparams}->{$myname}->{USED} = 1; + } $self->pidl_code("offset = $ifname\_dissect_struct_" . $t . "(tvb,offset,pinfo,tree,di,drep,$hf,$param);"); return; } $call =~ s/\@HF\@/$hf/g; - $call =~ s/\@PARAM\@/$param/g; + my $replacements = ($call =~ s/\@PARAM\@/$param/g); + if ($param ne 0 and $replacements ne 0) { + $self->{conformance}->{dissectorparams}->{$myname}->{USED} = 1; + } $self->pidl_code($call); } } elsif ($_->{TYPE} eq "SUBCONTEXT") { @@ -424,6 +430,7 @@ sub ElementLevel($$$$$$$$) $self->pidl_code("subtvb = tvb_new_subset_length_caplen(tvb, offset, (const int)size, -1);"); if ($param ne 0) { + $self->{conformance}->{dissectorparams}->{$myname}->{USED} = 1; $self->pidl_code("$myname\_(subtvb, 0, pinfo, tree, di, drep, $param);"); } else { $self->pidl_code("$myname\_(subtvb, 0, pinfo, tree, di, drep);");