Handle comment delimiters in generated C headers - #995
Open
Miko997 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Miko Parkkinen <Miko.parkkinen99@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, androsidl_generator_tests, including package lint checks. All checks passed after installing the missingfastjsonschematest dependency.