<br><br>On Saturday, December 8, 2012, Mathieu Desnoyers wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* Lai Jiangshan (<a href="javascript:;" onclick="_e(event, 'cvml', 'laijs@cn.fujitsu.com')">laijs@cn.fujitsu.com</a>) wrote:<br>
> The last expression result is unused and clang will complain.<br>
> The trick in the patch supresses the complaint<br>
<br>
Hrm, but with this patch, gcc complains:<br>
<br>
rculfhash.c:1921:3: warning: variable '_w' set but not used<br>
[-Wunused-but-set-variable]<br>
<br>
using<br>
<br>
gcc version 4.7.2 (Debian 4.7.2-4)</blockquote><div><br></div><div>Ouch, my gcc is too old<span></span></div><br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thoughts ?<br>
<br>
Thanks,<br>
<br>
Mathieu<br>
<br>
><br>
> Signed-off-by: Lai Jiangshan <<a href="javascript:;" onclick="_e(event, 'cvml', 'laijs@cn.fujitsu.com')">laijs@cn.fujitsu.com</a>><br>
> ---<br>
> urcu/system.h | 5 ++++-<br>
> 2 files changed, 4 insertions(+), 1 deletions(-)<br>
><br>
> diff --git a/urcu/system.h b/urcu/system.h<br>
> index 2a45f22..6b7b0af 100644<br>
> --- a/urcu/system.h<br>
> +++ b/urcu/system.h<br>
> @@ -46,12 +46,15 @@<br>
> /*<br>
> * Store v into x, where x is located in shared memory. Performs the<br>
> * required cache flush after writing. Returns v.<br>
> + * "_w" here avoids the warning from clang:<br>
> + * warning: expression result unused [-Wunused-value]<br>
> */<br>
> #define CMM_STORE_SHARED(x, v) \<br>
> ({ \<br>
> __typeof__(x) _v = _CMM_STORE_SHARED(x, v); \<br>
> + __typeof__(x) _w; \<br>
> cmm_smp_wmc(); \<br>
> - _v; \<br>
> + _w = _v; \<br>
> })<br>
><br>
> #endif /* _URCU_SYSTEM_H */<br>
> --<br>
> 1.7.4.4<br>
><br>
><br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="javascript:;" onclick="_e(event, 'cvml', 'lttng-dev@lists.lttng.org')">lttng-dev@lists.lttng.org</a><br>
> <a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
<br>
<br>
--<br>
Mathieu Desnoyers<br>
Operating System Efficiency R&D Consultant<br>
EfficiOS Inc.<br>
<a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a><br>
<br>
_______________________________________________<br>
lttng-dev mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'lttng-dev@lists.lttng.org')">lttng-dev@lists.lttng.org</a><br>
<a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
</blockquote>