[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: Fri, 04 Feb 2011 10:29:07 +0200

> Date: Thu, 03 Feb 2011 16:57:14 -0800
> From: Paul Eggert <address@hidden>
> CC: Stefan Monnier <address@hidden>, address@hidden
> On 02/03/11 13:14, Eli Zaretskii wrote:
> >> From: Stefan Monnier <address@hidden>
> >> 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.
> Actually, you can do it.  In the current trunk, the warning is
> ignored for one particular case, documented by wrapping the
> call in question by ignore_value (CALL).  This is in
> src/sysdep.c, line 583.

I know, but that's not what I meant, and I imagine that's not what
Stefan meant, either.  It is a truism that you can avoid the warning
by adding a call to another function that is not declared with the
warn_unused_result attribute.  What I meant was that it seems to be
impossible to tell the compiler not to emit this warning by the
"usual" C technique of using a cast.

Btw, isn't it ironic that gnulib, a GNU project, and all other GNU
projects that use gnulib, need to jump through the hoops to work
around misfeatures in glibc, one of the most important and core GNU

reply via email to

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