Fix array declarations in IDL serialization - #6530
Open
vpfkfl753 wants to merge 1 commit into
Open
Conversation
Reuse the struct member declaration formatting for aliases and union members so array bounds follow the declarator name. Cover one- and multidimensional arrays, chained aliases, and labelled and default union members. Check that serialized array aliases parse back into the same DynamicType. Fixes eProsima#6509 Signed-off-by: Sungwon Woo <vpfkfl753@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
idl_serialize()writes array bounds before the name in typedefs and union members, for exampletypedef double[9] Covariance;. Reuse the struct-member declaration formatting so the bounds follow the name.The regression tests cover one- and multidimensional arrays, chained aliases, and labelled/default union members. The alias test also parses the emitted IDL and compares the resulting type.
Tested on Ubuntu 24.04 with GCC 13.3, Debug: both new tests fail before the fix; all 16 IDL serialization tests pass after it. Uncrustify passes. Local line coverage of
dynamic_type_idl.cppincreases from 480/590 (81.36%) to 488/599 (81.47%). The linked nightly coverage server timed out, so this comparison uses the local baseline.Backport:
3.6.xhas the same serializer; the patch applies cleanly there.Fixes #6509.
Contributor Checklist
versions.mdfile (if applicable). Bug fix; no new feature.Reviewer Checklist