[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100619074413.GB18946@basil.fritz.box>
Date: Sat, 19 Jun 2010 09:44:13 +0200
From: Andi Kleen <andi@...stfloor.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [4/23] pagemap: Avoid unused-but-set variable
> urgh. In fact I'd urgh the whole patchset.
>
> Problem is, anyone who looks at all these random (void) casts is going
There are actually not that many in the patch kit if you read it
completely. I think that's nearly the only one outside a macro.
> to have a hard time working out why they're there. This is worsened by
> the long-standing practice wherein some people put unneeded (void) casts all
> over the place due to being traumatised by lint 15 years ago (I think).
It's really the same reason why they used this with lints.
When I tried it first I started complaining about gcc too (I even
filled a gcc bug), then disabled it in my build,
but after some contemplation I found it really finds real bugs.
>
> Wouldn't it be better to make this stuff self-documenting, so anyone
> who reads the code can immediately see what it's doing, rather than
> scratching their heads over random, seemingly-unneeded casts?
>
> #define gcc_46_is_a_pita(expr) ((void)(expr))
The warning is really useful and we'll get all used to it.
So I went with the plain cast. Maybe some more comments would
be useful.
-Andi
--
ak@...ux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists