Skip to content

Handle comment delimiters in generated C headers - #995

Open
Miko997 wants to merge 1 commit into
ros2:rollingfrom
Miko997:fix-c-comment-delimiters
Open

Handle comment delimiters in generated C headers#995
Miko997 wants to merge 1 commit into
ros2:rollingfrom
Miko997:fix-c-comment-delimiters

Conversation

@Miko997

@Miko997 Miko997 commented Sep 9, 2026

Copy link
Copy Markdown

Description

Embedded comment delimiters in message or constant documentation can break generated C headers. Escape both /* and */ inside their existing block comments, retaining documentation and field-comment behavior.

Fixes #994.

Is this user-facing behavior change?

These comments now generate valid C, including when documentation ends with a backslash.

Did you use Generative AI?

Codex (GPT-6) wrote the fix and regression coverage and assisted with local testing and code review.

Additional Information

Verified failure before and success after with the actual adapter/parser/C generator. Ten generated-header cases pass GCC C11 with -Wall -Wextra -Werror -Wpedantic. Added a message fixture to the existing C compilation test.

Local ROS Rolling container: built and tested rosidl_adapter, rosidl_parser, rosidl_pycommon, rosidl_generator_type_description, rosidl_generator_c, rosidl_generator_cpp, and rosidl_generator_tests, including package lint checks. All checks passed after installing the missing fastjsonschema test dependency.

Signed-off-by: Miko Parkkinen <Miko.parkkinen99@gmail.com>
@kscottz

kscottz commented Sep 10, 2026

Copy link
Copy Markdown

@Shru

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.

rosidl_generator_c: */ in a message or constant comment closes the generated /** */ block and breaks compilation

2 participants