Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore zero-variadic-macro-arguments warnings from lttng-ust macros #126

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading