From: Dave Jones <davej@codemonkey.org.uk>
To: Yury Norov <ynorov@caviumnetworks.com>
Cc: trinity@vger.kernel.org, Andrew Pinski <Andrew.Pinski@cavium.com>,
Steve Ellcey <Steve.Ellcey@cavium.com>
Subject: Re: [PATCH] Fix -Wunused error
Date: Sat, 26 Nov 2016 21:56:15 -0500 [thread overview]
Message-ID: <20161127025615.fgewhrif2xr576md@codemonkey.org.uk> (raw)
In-Reply-To: <1480037868-28007-1-git-send-email-ynorov@caviumnetworks.com>
On Fri, Nov 25, 2016 at 07:07:48AM +0530, Yury Norov wrote:
> I try to build trinity for aarch64. In my configuration USE_PPPOL2TPIN6
> is not defined, and it makes some functions have unused variables. GCC
> treats it as error. This patch fixes it.
>
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> ---
> net/proto-pppox.c | 9 +++++++++
> rand/seed.c | 2 ++
> 2 files changed, 11 insertions(+)
>
> diff --git a/net/proto-pppox.c b/net/proto-pppox.c
> index 9deb045..bdec306 100644
> --- a/net/proto-pppox.c
> +++ b/net/proto-pppox.c
> @@ -83,6 +83,9 @@ static void pppox_PX_PROTO_OL2TP_PPPoL2TPin6(struct sockaddr **addr, socklen_t *
> pppol2tpin6->pppol2tp.addr.sin6_scope_id = rnd();
> *addr = (struct sockaddr *) pppol2tpin6;
> *addrlen = sizeof(struct sockaddr_pppol2tpin6);
> +#else
> + (void) addr;
> + (void) addrlen;
Instead of doing it this way, just add __unused__ tags to the variable
declarations. (In the case where they're actually used, it doesn't
matter)
thanks,
Dave
next prev parent reply other threads:[~2016-11-27 2:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 1:37 [PATCH] Fix -Wunused error Yury Norov
2016-11-27 2:56 ` Dave Jones [this message]
2016-11-27 7:20 ` Yury Norov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161127025615.fgewhrif2xr576md@codemonkey.org.uk \
--to=davej@codemonkey.org.uk \
--cc=Andrew.Pinski@cavium.com \
--cc=Steve.Ellcey@cavium.com \
--cc=trinity@vger.kernel.org \
--cc=ynorov@caviumnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).