[Bug 258513] net-mgmt/pmacct: fix build with clang 13

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 15 Sep 2021 13:33:50 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258513

            Bug ID: 258513
           Summary: net-mgmt/pmacct: fix build with clang 13
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: pi@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(pi@FreeBSD.org)
          Assignee: pi@FreeBSD.org

During an exp-run for llvm 13 (see bug 258209), it turned out that
net-mgmt/pmacct fails to build with clang 13:

netflow9.c:2236:25: error: variable 'tot_len' set but not used
[-Werror,-Wunused-but-set-variable]
                        u_int16_t flows = 0, tot_len = 0;
                                             ^
1 error generated.

In this particular instance, the 'tot_len' variable does not seem to have any
purpose, nor does it have any further side-effects. There is one more instance
of a set but unused variable 'label' in src/sflow.c, but the code there is also
increasing a byte ptr, so it can't easily be eliminated.

For now I think it is best to mark these variables as unused, with an
attribute. Alternatively, we can suppress the -Wunused-but-set warning for
clang 13 and higher, but this requires a patch to the configure script.

-- 
You are receiving this mail because:
You are the assignee for the bug.