Fix c99 compatibility: tp_rcu_dereference_bp() should not use braced-groups within...
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 18 Jun 2012 14:22:12 +0000 (10:22 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 18 Jun 2012 17:51:17 +0000 (13:51 -0400)
Allow tp_rcu_dereference_bp() to be used within programs compiled with
--std=c99 -pedantic -Werror. Fixes the following:

In file included from hello.c:34:0:
ust_tests_hello.h: In function ‘__tracepoint_cb_ust_tests_hello___tptest’:
ust_tests_hello.h:28:1: warning: ISO C forbids braced-groups within expressions [-pedantic]
ust_tests_hello.h:28:1: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]

We can easily fix this one since tp_rcu_dereference_bp() really
evaluates only a single expression.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint-rcu.h

index a754048cc51ccc624a028c522aa8a030fbf04fcf..2e0a79fd02d6cf88363252393a4f13011eedfb78 100644 (file)
 #define tp_rcu_read_lock_bp    tracepoint_dlopen.rcu_read_lock_sym_bp
 #define tp_rcu_read_unlock_bp  tracepoint_dlopen.rcu_read_unlock_sym_bp
 
-#define tp_rcu_dereference_bp(p)                                            \
-       ({                                                                   \
-               __typeof__(p) _________p1 = URCU_FORCE_CAST(__typeof__(p),   \
-                       tracepoint_dlopen.rcu_dereference_sym_bp(URCU_FORCE_CAST(void *, p))); \
-               (_________p1);                                               \
-       })
+#define tp_rcu_dereference_bp(p)                                          \
+               URCU_FORCE_CAST(__typeof__(p),                             \
+                       tracepoint_dlopen.rcu_dereference_sym_bp(URCU_FORCE_CAST(void *, p)))
 
 #define TP_RCU_LINK_TEST()     tp_rcu_read_lock_bp
 
This page took 0.024686 seconds and 4 git commands to generate.