Skip to content

TRACEPOINT_EVENT used in tp_call.h can't be found by cppcheck 1.9.0 when TRACING_ENABLED is false

Related to https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing/-/merge_requests/140.

Even considering merge request #140 (closed), cppcheck 1.9.0 will throw an error about not being able to find the TRACEPOINT_EVENT macro in tp_call.h when TRACING_ENABLED is false. Because tp_call.h is in an include_directory it's evaluated by cppcheck even though it's not in sources. However, if find_package(LTTNG) is not run, then lttng's include directories cannot be added to ament_cmake_cppcheck's additional include directories.

Examples: http://build.ros2.org/view/Fci/job/Fci__nightly-debug_ubuntu_focal_amd64/lastCompletedBuild/testReport/tracetools/cppcheck/error__unknownMacro__include_tracetools_tp_call_h_33_/ https://ci.ros2.org/job/ci_windows-container/211/testReport/tracetools/cppcheck/error__unknownMacro__include_tracetools_tp_call_h_33_/