From owner-dev-commits-ports-main@freebsd.org Wed Sep 22 18:46:35 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC2D166F570; Wed, 22 Sep 2021 18:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HF6hW6LRlz4rHg; Wed, 22 Sep 2021 18:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB25C1C82A; Wed, 22 Sep 2021 18:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18MIkZ4d066038; Wed, 22 Sep 2021 18:46:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MIkZT5066037; Wed, 22 Sep 2021 18:46:35 GMT (envelope-from git) Date: Wed, 22 Sep 2021 18:46:35 GMT Message-Id: <202109221846.18MIkZT5066037@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: f508cdd3cc28 - main - net-mgmt/pmacct: mark unused but set variables with attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f508cdd3cc283c3ce68f7070eec18ce68573dfe5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2021 18:46:36 -0000 The branch main has been updated by dim (src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=f508cdd3cc283c3ce68f7070eec18ce68573dfe5 commit f508cdd3cc283c3ce68f7070eec18ce68573dfe5 Author: Dimitry Andric AuthorDate: 2021-09-22 18:43:17 +0000 Commit: Dimitry Andric CommitDate: 2021-09-22 18:43:17 +0000 net-mgmt/pmacct: mark unused but set variables with attributes With clang 13, building net-mgmt/pmacct results in a number of warnings: 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; ^ 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 mark these variables as unused, with an attribute. Approved by: pi (maintainer) PR: 258513 MFC: 2021Q3 --- net-mgmt/pmacct/Makefile | 1 + net-mgmt/pmacct/files/patch-src_nfprobe__plugin_netflow9.c | 11 +++++++++++ net-mgmt/pmacct/files/patch-src_sflow.c | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/net-mgmt/pmacct/Makefile b/net-mgmt/pmacct/Makefile index 314230e3e2d4..15b98614f119 100644 --- a/net-mgmt/pmacct/Makefile +++ b/net-mgmt/pmacct/Makefile @@ -2,6 +2,7 @@ PORTNAME= pmacct DISTVERSION= 1.7.5 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= http://www.pmacct.net/ diff --git a/net-mgmt/pmacct/files/patch-src_nfprobe__plugin_netflow9.c b/net-mgmt/pmacct/files/patch-src_nfprobe__plugin_netflow9.c new file mode 100644 index 000000000000..6ba07373eba9 --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_nfprobe__plugin_netflow9.c @@ -0,0 +1,11 @@ +--- src/nfprobe_plugin/netflow9.c.orig 2020-05-10 13:57:54 UTC ++++ src/nfprobe_plugin/netflow9.c +@@ -2233,7 +2233,7 @@ send_netflow_v9(struct FLOW **flows, int num_flows, in + + /* Refresh template headers if we need to */ + if (nf9_pkts_until_template <= 0) { +- u_int16_t flows = 0, tot_len = 0; ++ u_int16_t flows = 0, tot_len __attribute__((unused)) = 0; + + memcpy(packet + offset, &v4_template, v4_template.tot_len); + offset += v4_template.tot_len; diff --git a/net-mgmt/pmacct/files/patch-src_sflow.c b/net-mgmt/pmacct/files/patch-src_sflow.c new file mode 100644 index 000000000000..8a8df0620e6c --- /dev/null +++ b/net-mgmt/pmacct/files/patch-src_sflow.c @@ -0,0 +1,11 @@ +--- src/sflow.c.orig 2020-05-10 13:57:54 UTC ++++ src/sflow.c +@@ -306,7 +306,7 @@ void decodeIPV4(SFSample *sample) + + void decodeIPV6(SFSample *sample) + { +- u_int32_t label; ++ u_int32_t label __attribute__((unused)); + u_int32_t nextHeader; + u_char *end = sample->header + sample->headerLen; +