Fix: tracepoint.h should not generate old-style definitions
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 11 Jun 2012 13:53:07 +0000 (09:53 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 11 Jun 2012 13:55:12 +0000 (09:55 -0400)
commit86637aa6452f66dee5f769461668c2ea059b3a30
treeb1662a1800a0f8008e7b6c19f9ba97edfbf0f82f
parent5a821cd6258af4b44aac352bd89b715377cee7d2
Fix: tracepoint.h should not generate old-style definitions

I've defined a tracepoint without arguments:

   TRACEPOINT_EVENT(

        qemu_tb_hash,

        flushall,

        TP_ARGS(void),

        TP_FIELDS()

   )

When I build (with -Werror=old-style-definition), I get this error:

   In file included from /home/hollisb/work/qemu.git/exec.c:59:0:

   /home/hollisb/work/qemu.git/tracepoints.h:24:2: error: function declaration isn’t a prototype [-Werror=strict-prototypes]

   /home/hollisb/work/qemu.git/tracepoints.h: In function ‘__tracepoint_cb_qemu_tb_hash___flushall’:

   /home/hollisb/work/qemu.git/tracepoints.h:24:2: error: old-style function definition [-Werror=old-style-definition]

   cc1: all warnings being treated as errors

The preprocessed code looks like so:

   extern struct

   # 129 "/usr/local/include/lttng/tracepoint.h" 3

                  tracepoint

   # 24 "/home/hollisb/work/qemu.git/tracepoints.h"

     __tracepoint_qemu_tb_hash___flushall

   # 19 "/home/hollisb/work/qemu.git/tracepoints.h"

     ; static __attribute__ (( always_inline )) __inline__ void

     __tracepoint_cb_qemu_tb_hash___flushall

   # 19 "/home/hollisb/work/qemu.git/tracepoints.h"

     () { struct tracepoint_probe *__tp_probe; if (!tracepoint_dlopen.rcu_read_lock_sym_bp) return; tracepoint_dlopen.rcu_read_lock_sym_bp(); __tp_probe = ({ typeof(__tracepoint_qemu_tb_hash___flushall.probes) _________p1 = ((typeof(__tracepoint_qemu_tb_hash___flushall.probes)) (tracepoint_dlopen.rcu_dereference_sym_bp(((void *) (__tracepoint_qemu_tb_hash___flushall.probes))))); (_________p1); }); if (__builtin_expect(!!(!__tp_probe), 0)) goto end; do { void *__tp_cb = __tp_probe->func; void *__tp_data = __tp_probe->data; ((void (*)(void *__tp_data)) (__tp_cb)) (__tp_data); } while ((++__tp_probe)->func); end: tracepoint_dlopen.rcu_read_unlock_sym_bp(); } static __attribute__ (( always_inline )) __inline__ void

I believe the problem comes from -Werror=old-style-definition not liking
that empty "()", i.e. tracepoint_cb_qemu_tb_hash___flushall() { ... }.

Reported-by: Hollis Blanchard <hollis_blanchard@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint.h
This page took 0.03104 seconds and 5 git commands to generate.