<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#c8">Comment # 8</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:spitzak@gmail.com" title="Bill Spitzak <spitzak@gmail.com>"> <span class="fn">Bill Spitzak</span></a>
</span></b>
<pre>On 05/12/2014 11:28 PM, <a href="mailto:bugzilla-daemon@freedesktop.org">bugzilla-daemon@freedesktop.org</a> wrote:
<span class="quote">> *<a href="show_bug.cgi?id=58727#c7">Comment # 7</a> <<a class="bz_bug_link
bz_status_NEW "
title="NEW --- - warn_unused_result noise"
href="show_bug.cgi?id=58727#c7">https://bugs.freedesktop.org/show_bug.cgi?id=58727#c7</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 Ravi
> Nanjundappa <<a href="mailto:nravi.n@samsung.com">mailto:nravi.n@samsung.com</a>> *</span >
>
<span class="quote">> (In reply tocomment #6 <show_bug.cgi?id=58727#c6>)
>> 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 >
>
<span class="quote">> 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></span >
>
<span class="quote">> Bill,
> Could you please share your opinion on this?</span >
My tests just confirm that the ridiculous workaround described in the
link (of using a temporary and casting *that* to void) is required by
gcc, instead of the more sensible workaround of casting the function
call to void.
I have no opinion on whether removing the warn-unused-result attribute
from that function, or adding the workaround, or figuring out if the
code should in fact should be paying attention to the result.</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>