This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] PR/24900: computed but not used cast values
Richard Henderson wrote:-
> On Thu, Nov 17, 2005 at 03:18:00PM -0800, Ian Lance Taylor wrote:
> > I don't think you should get a warning for not using the return value of a
> > function, at least not under -Wunused.
>
> For this, I agree. Except that we're not talking about the
> return value of the function directly, we're talking about
> the return value of a cast.
>
> Given that one can always cast any value to void to suppress
> this warning, I'm unconcerned about getting every single edge
> case "correct". Especially for edge cases for which one can
> reasonably disagree as to what is correct.
My 2 cents:
a) the warning should stay, but the wording should be about a
pointless (or unused) cast instead
b) the kernel folks should have 2 macros, with and without the
cast, and use whichever is appropriate. Assuming the cast
is useful somewhere, of course.
Neil.