Discussion:
unused variable
Iain Hibbert
2014-08-13 13:31:14 UTC
Permalink
Hi

via NetBSD (using gcc4.8) I came across an unused variable reference in
arch/amd64/local2.c.

static void
ldtoul(NODE *p)
{
int r;

r = getlr(p, '1')->n_rval;

now, this result is not important since the rval is not actually used, but
I see that the getlr() call has a side effect of verifying that the res[1]
node in this case is not FREE, otherwise a compiler error will result.

I wonder if that is important, in which case I could just change it to

(void)getlr(p, '1')

or is it ok to just remove it entirely?

regards,
iain
Anders Magnusson
2014-08-13 19:50:13 UTC
Permalink
Post by Iain Hibbert
Hi
via NetBSD (using gcc4.8) I came across an unused variable reference in
arch/amd64/local2.c.
static void
ldtoul(NODE *p)
{
int r;
r = getlr(p, '1')->n_rval;
now, this result is not important since the rval is not actually used, but
I see that the getlr() call has a side effect of verifying that the res[1]
node in this case is not FREE, otherwise a compiler error will result.
I wonder if that is important, in which case I could just change it to
(void)getlr(p, '1')
or is it ok to just remove it entirely?
Please remove it. expand() is used to get allocated needs instead of
this hand-grown leftover.

-- Ragge

Loading...