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

Conversation

christophebedard
Copy link
Member

Fixes #105

The warnings are due to the lttng-ust macros. While the relevant tracetools macros have two variants to handle tracepoints with and without arguments (see comment in tracetools.h), the lttng-ust macros do not:

#define lttng_ust_do_tracepoint(provider, name, ...)

This will be called without any variadic arguments by the tracetools _CONDITIONAL_DO_TP() macro (see tracetools.c). For example, in rough order of expansion:

// 1.
DEFINE_TRACEPOINT_NO_ARGS(
  rclcpp_executor_get_next_ready)

// 2.
_CONDITIONAL_DO_TP(rclcpp_executor_get_next_ready)

// 3.
do_tracepoint(ros2, rclcpp_executor_get_next_ready)

// 4.
lttng_ust_do_tracepoint(ros2, rclcpp_executor_get_next_ready)

Therefore, ignore the gnu-zero-variadic-macro-arguments warning with clang in tp_call.h (where lttng-ust macros are used to define tracepoint events) and in tracetools.c (where lttng-ust macros are used to trigger tracepoint events).

@christophebedard christophebedard self-assigned this Jul 4, 2024
@christophebedard
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

I used the CI_COMPILE_WITH_CLANG option from ci_launcher, but maybe I should've just triggered a separate ci_linux_clang_libcxx job?

Copy link
Contributor

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with green CI. CI failures seem unrelated to this fix.

@christophebedard
Copy link
Member Author

christophebedard commented Jul 5, 2024

The jobs above show that the warnings have disappeared. Looks like there's an unrelated issue with clang/libstdc++ on RHEL.

Triggering another round of CI without CI_COMPILE_WITH_CLANG just to double check that this is fine without clang:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@christophebedard christophebedard merged commit 74ff10b into rolling Jul 5, 2024
9 checks passed
@christophebedard christophebedard deleted the christophebedard/ignore-clang-gnu-zero-variadic-macro-arguments branch July 5, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clang warning
3 participants