From: Mathieu Desnoyers Date: Tue, 12 Jun 2012 15:51:31 +0000 (-0400) Subject: Fix strict ISO-C compatibility for ust-tracepoint-event.h public header X-Git-Tag: v2.1.0-rc1~63 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2eda209b5805e2ece837f436fca063ba2775e4ff;p=lttng-ust.git Fix strict ISO-C compatibility for ust-tracepoint-event.h public header ../../include/lttng/ust-tracepoint-event.h:328:23: warning: ISO C does not permit named variadic macros [-Wvariadic-macros] Use ... and __VA_ARGS__ instead of args... and args. This enables ISO-C compability for the tracepoint headers for program instrumentation. Note that the probes need to be built _without_ strict C99 flags (they require gnu extensions). Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index c2e95192..28ac8d80 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -204,7 +204,7 @@ static const char \ }, #undef TP_FIELDS -#define TP_FIELDS(args...) args /* Only one used in this phase */ +#define TP_FIELDS(...) __VA_ARGS__ /* Only one used in this phase */ #undef TRACEPOINT_EVENT_CLASS #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \ @@ -224,7 +224,7 @@ static const char \ #include #undef TP_ARGS -#define TP_ARGS(args...) args +#define TP_ARGS(...) __VA_ARGS__ #undef TRACEPOINT_EVENT_CLASS #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \ @@ -271,10 +271,10 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)); __event_len += __dynamic_len[__dynamic_len_idx++] = strlen(_src) + 1; #undef TP_ARGS -#define TP_ARGS(args...) args +#define TP_ARGS(...) __VA_ARGS__ #undef TP_FIELDS -#define TP_FIELDS(args...) args +#define TP_FIELDS(...) __VA_ARGS__ #undef TRACEPOINT_EVENT_CLASS #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \ @@ -322,10 +322,10 @@ static inline size_t __event_get_size__##_provider##___##_name(size_t *__dynamic #define ctf_string(_item, _src) #undef TP_ARGS -#define TP_ARGS(args...) args +#define TP_ARGS(...) __VA_ARGS__ #undef TP_FIELDS -#define TP_FIELDS(args...) args +#define TP_FIELDS(...) __VA_ARGS__ #undef TRACEPOINT_EVENT_CLASS #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \ @@ -393,10 +393,10 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ #define __get_dynamic_len(field) __dynamic_len[__dynamic_len_idx++] #undef TP_ARGS -#define TP_ARGS(args...) args +#define TP_ARGS(...) __VA_ARGS__ #undef TP_FIELDS -#define TP_FIELDS(args...) args +#define TP_FIELDS(...) __VA_ARGS__ #undef TRACEPOINT_EVENT_CLASS #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \ @@ -444,7 +444,7 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))\ #include #undef TP_ARGS -#define TP_ARGS(args...) args +#define TP_ARGS(...) __VA_ARGS__ #define _TP_EXTRACT_STRING2(...) #__VA_ARGS__