Skip to content

[ament_cppcheck] Unable to resolve macro definitions from includes #116

@jacobperron

Description

@jacobperron

With the latest release of cppcheck (v1.86), tests have started failing in rclcpp with the following error message (or very similar):

There is an unknown macro here somewhere. Configuration is required. If RCLCPP_SMART_PTR_DEFINITIONS is a macro then please configure it.

Example build: https://ci.ros2.org/view/All/job/test_ci_osx/118/


I don't believe this is an error in rclcpp itself, but with how cppcheck is invoked.
If cppcheck is invoked with the -I option, passing the include directory, then the error goes away.
E.g.

cppcheck -I rclcpp/rclcpp/include  rclcpp/rclcpp/include/rclcpp/client.hpp

Documentation for the -I option:

    -I <dir>             Give path to search for include files. Give several -I
                         parameters to give several paths. First given path is
                         searched for contained header files first. If paths are
                         relative to source files, this is not needed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions