Skip to content

Commit

Permalink
Ignore zero-variadic-macro-arguments warnings from lttng-ust macros (#…
Browse files Browse the repository at this point in the history
…126)

Signed-off-by: Christophe Bedard <[email protected]>
  • Loading branch information
christophebedard authored Jul 5, 2024
1 parent 00a4e99 commit 74ff10b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tracetools/include/tracetools/tp_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
/// See RMW_GID_STORAGE_SIZE in rmw.
#define TRACETOOLS_GID_STORAGE_SIZE 24u

#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif

TRACEPOINT_EVENT(
TRACEPOINT_PROVIDER,
rcl_init,
Expand Down Expand Up @@ -509,6 +514,10 @@ TRACEPOINT_EVENT(
)
)

#ifdef __clang__
# pragma clang diagnostic pop
#endif

#endif // _TRACETOOLS__TP_CALL_H_

#include <lttng/tracepoint-event.h>
Expand Down
13 changes: 12 additions & 1 deletion tracetools/src/tracetools.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# define _CONDITIONAL_TP(...) ((void) (0))
# define _CONDITIONAL_TP_ENABLED(...) false
# define _CONDITIONAL_DO_TP(...) ((void) (0))
#endif
#endif // TRACETOOLS_TRACEPOINTS_EXCLUDED

#define TRACEPOINT_ARGS(...) __VA_ARGS__
#define TRACEPOINT_PARAMS(...) __VA_ARGS__
Expand Down Expand Up @@ -77,6 +77,7 @@ bool ros_trace_compile_status()
#endif
}

// Ignore unused-parameters warning when tracepoints are excluded
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-parameter"
Expand All @@ -85,6 +86,12 @@ bool ros_trace_compile_status()
# pragma warning(disable: 4100)
#endif

// Ignore zero-variadic-macro-arguments clang warnings caused by lttng-ust macros
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif

DEFINE_TRACEPOINT(
rcl_init,
TRACEPOINT_PARAMS(
Expand Down Expand Up @@ -417,6 +424,10 @@ DEFINE_TRACEPOINT(
TRACEPOINT_ARGS(
buffer))

#ifdef __clang__
# pragma clang diagnostic pop
#endif

#ifndef _WIN32
# pragma GCC diagnostic pop
#else
Expand Down

0 comments on commit 74ff10b

Please sign in to comment.