Skip to content

Using C / C++ keywords as package name / field names results into compilation error #272

@firesurfer

Description

@firesurfer

I realised today that using C++ keywords as fieldnames results into a compilation error.
Example:

bool delete false

Will result into:

rosidl_generator_cpp/iboss_msgs/msg/request_stored_data__struct.hpp:90:16: error: expected member name or ';' after declaration specifiers
  _delete_type delete;

It would be great if either the message generator would throw an error like: Don't use c++ keywords or
the message generator would somehow escape these fields.
If this is not a viable solution for you I think a hint in the documentation would be useful:
https://github.com/ros2/ros2/wiki/About-ROS-Interfaces

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions