[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: attribute warn_unused_result

From: Eli Zaretskii
Subject: Re: attribute warn_unused_result
Date: Thu, 03 Feb 2011 23:14:27 +0200

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Thu, 03 Feb 2011 13:53:25 -0500
> > Do we care about these warnings?  There's significant controversy
> > about them (e.g., the warnings about `write' are when we write an
> > error message to stderr, in which case there's nothing useful one can
> > do with the return value), so I'm not sure we should care.
> I think the right thing to do is to adjust the code so as to make it
> clear to the compiler that we thought about the issue and decided that
> we really do want to ignore the return value.

You can't do that, not with this warning.

> So, for each such case, we should think about it and if we indeed want
> to ignore the return value, we should put an explicit cast to that
> effect (which should hopefully be understood by gcc to silence the
> warning).

It isn't.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]