Function attributes should be located after the declaration.
Change-Id: I1c1622b3102f4a9d2fc5df35b5dfc290abac48aa
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#include <lttng/tracef.h>
-__attribute__((format(printf, 1, 2)))
+static
+void print_debug(const char* msg, ...)
+ __attribute__((format(printf, 1, 2)));
+static
void print_debug(const char* msg, ...)
{
va_list ap;
#include <lttng/tracelog.h>
-__attribute__((format(printf, 1, 2)))
+static
+void print_err(const char* msg, ...)
+ __attribute__((format(printf, 1, 2)));
+static
void print_err(const char* msg, ...)
{
va_list ap;
#endif
extern
-__attribute__((format(printf, 1, 2)))
-void _lttng_ust_tracef(const char *fmt, ...);
+void _lttng_ust_tracef(const char *fmt, ...)
+ __attribute__((format(printf, 1, 2)));
extern
-__attribute__((format(printf, 1, 0)))
-void _lttng_ust_vtracef(const char *fmt, va_list ap);
+void _lttng_ust_vtracef(const char *fmt, va_list ap)
+ __attribute__((format(printf, 1, 0)));
#define tracef(fmt, ...) \
do { \
#endif
#define TP_TRACELOG_CB_TEMPLATE(level) \
- __attribute__ ((format(printf, 4, 5))) \
extern void _lttng_ust_tracelog_##level(const char *file, \
- int line, const char *func, const char *fmt, ...); \
- __attribute__ ((format(printf, 4, 0))) \
+ int line, const char *func, const char *fmt, ...) \
+ __attribute__ ((format(printf, 4, 5))); \
+ \
extern void _lttng_ust_vtracelog_##level(const char *file, \
- int line, const char *func, const char *fmt, va_list ap);
+ int line, const char *func, const char *fmt, \
+ va_list ap) \
+ __attribute__ ((format(printf, 4, 0)));
TP_TRACELOG_CB_TEMPLATE(TRACE_EMERG);
TP_TRACELOG_CB_TEMPLATE(TRACE_ALERT);
#define TRACEPOINT_DEFINE
#include "lttng-ust-tracef-provider.h"
-static inline __attribute__((always_inline, format(printf, 1, 0)))
+static inline
+void __lttng_ust_vtracef(const char *fmt, va_list ap)
+ __attribute__((always_inline, format(printf, 1, 0)));
+static inline
void __lttng_ust_vtracef(const char *fmt, va_list ap)
{
char *msg;
return;
}
-__attribute__((format(printf, 1, 0)))
-void _lttng_ust_vtracef(const char *fmt, va_list ap);
+void _lttng_ust_vtracef(const char *fmt, va_list ap)
+ __attribute__((format(printf, 1, 0)));
void _lttng_ust_vtracef(const char *fmt, va_list ap)
{
__lttng_ust_vtracef(fmt, ap);
}
-__attribute__((format(printf, 1, 2)))
-void _lttng_ust_tracef(const char *fmt, ...);
+void _lttng_ust_tracef(const char *fmt, ...)
+ __attribute__((format(printf, 1, 2)));
void _lttng_ust_tracef(const char *fmt, ...)
{
va_list ap;
#include "lttng-ust-tracelog-provider.h"
#define TRACELOG_CB(level) \
- static inline __attribute__((always_inline, format(printf, 4, 0))) \
+ static inline \
+ void __lttng_ust_vtracelog_##level(const char *file, \
+ int line, const char *func, \
+ const char *fmt, va_list ap) \
+ __attribute__((always_inline, format(printf, 4, 0))); \
+ \
+ static inline \
void __lttng_ust_vtracelog_##level(const char *file, \
int line, const char *func, \
const char *fmt, va_list ap) \
return; \
} \
\
- __attribute__ ((format(printf, 4, 0))) \
+ void _lttng_ust_vtracelog_##level(const char *file, \
+ int line, const char *func, \
+ const char *fmt, va_list ap) \
+ __attribute__ ((format(printf, 4, 0))); \
+ \
void _lttng_ust_vtracelog_##level(const char *file, \
int line, const char *func, \
const char *fmt, va_list ap) \
__lttng_ust_vtracelog_##level(file, line, func, fmt, ap); \
} \
\
- __attribute__ ((format(printf, 4, 5))) \
+ void _lttng_ust_tracelog_##level(const char *file, \
+ int line, const char *func, \
+ const char *fmt, ...) \
+ __attribute__ ((format(printf, 4, 5))); \
+ \
void _lttng_ust_tracelog_##level(const char *file, \
int line, const char *func, \
const char *fmt, ...) \