Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

Compilation fail for messages with c++ keywords as field names #31

Closed
@mikepurvis

Description

@mikepurvis

The Python generation code contains logic to append with underscore any fields that match a Python keyword:

https://github.com/ros/genpy/blob/45ecd5415fc4711a3afbdf3c2923b59fa742b436/src/genpy/generator.py#L224-L225

However, there's no such thing in the gencpp code, so we got tripped up when we had a message with established Python usage that had class as a field name, and then got used in C++ and wouldn't compile.

For now we've simply renamed our field to class_, but it would be great to see this transformation happen in gencpp itself, as it does in genpy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions