<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - warn_unused_result noise"
href="https://bugs.freedesktop.org/show_bug.cgi?id=58727#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - warn_unused_result noise"
href="https://bugs.freedesktop.org/show_bug.cgi?id=58727">bug 58727</a>
from <span class="vcard"><a class="email" href="mailto:nravi.n@samsung.com" title="Ravi Nanjundappa <nravi.n@samsung.com>"> <span class="fn">Ravi Nanjundappa</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=58727#c6">comment #6</a>)
<span class="quote">> I think the complaint is about strtol(), which is being used apparently
> to find the other end of the numeric value (returned in the char** arg)
> while the number is ignored, thus causing this error.
>
> It does seem that nobody is going to "accidentally" ignore the result of
> strtol. The warning really should be on functions returning things you
> *must* do something with, for instance malloc() where if you don't free
> the returned value you have a memory leak.
>
> And they really should restore the (void)fn() work-around, which is
> readable.</span >
In some of the cases (for ex: _cairo_polygon_add_external_edge()), the return
values of the callee are used by the caller (for ex: ln. no. 63 and 177 in
cairo-path-fill.c file), while in other cases it is ignored for some reasons.
The warnings are thrown in these scenarios. In such a case, I fell like we can
use the approach provided by Sergey Shandar, @
<a href="http://stackoverflow.com/questions/3614691/casting-to-void-doesnt-remove-warn-unused-result-error">http://stackoverflow.com/questions/3614691/casting-to-void-doesnt-remove-warn-unused-result-error</a>
Bill,
Could you please share your opinion on this?
<span class="quote">>
> On 05/07/2014 07:34 AM, <a href="mailto:bugzilla-daemon@freedesktop.org">bugzilla-daemon@freedesktop.org</a> wrote:
> > *<a href="show_bug.cgi?id=58727#c5">Comment # 5</a> <<a class="bz_bug_link
bz_status_NEW "
title="NEW --- - warn_unused_result noise"
href="show_bug.cgi?id=58727#c5">https://bugs.freedesktop.org/show_bug.cgi?id=58727#c5</a>> on
> > <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - warn_unused_result noise"
href="show_bug.cgi?id=58727">bug 58727</a> <<a class="bz_bug_link
bz_status_NEW "
title="NEW --- - warn_unused_result noise"
href="show_bug.cgi?id=58727">https://bugs.freedesktop.org/show_bug.cgi?id=58727</a>> from
> > Daniel Macks <<a href="mailto:dmacks@netspace.org">mailto:dmacks@netspace.org</a>> *
> >
> > Thinking slightly more philosophically, do those functions really need to be
> > (warn_unused_result)? Or, if it's important not to ignore the result, why are
> > we ignoring the result?
> >
> > ------------------------------------------------------------------------
> > You are receiving this mail because:
> >
> > * You are watching the QA Contact of the bug.
> ></span ></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>