Add support for try construct#2377
Merged
eboasson merged 38 commits intoMay 4, 2026
Merged
Conversation
7d8f91e to
998901e
Compare
See XTypes 1.3 table 19: Any members in T1 and T2 that have the same name also have the same ID and any members with the same ID also have the same name. We only looked at the name for members with the same ID (the second half of the sentence). This commits adds a check that the other way round. Checking the name hash is not a correct implementation of this requirement, but assignability is supposed to be determined from the minimal type ids, and this is therefore all we have.
This allows DDS_DYNAMIC_MEMBER_ID_AUTO as the member_id argument when updating a member and interprets it as the most recently added member.
Co-authored-by: Dennis Potman <dennis@zettascale.tech> Signed-off-by: Erik Boasson <eb@ilities.com>
This is still very rudimentary with bad error handling, undocumented limitations and certainly some leaks in error paths (and perhaps in non-error paths), but it has already proven to be quite useful.
Microsoft started warning, now Clang. It is only a matter of time until GCC and other compilers add a warning. This * replaces all macros used in generated code by #defines, * changes the name of the enum symbols from DDS_OP to DDS_SOP (etc.), This ensures the generated code compiles cleanly and that the CDR serializer code still checks all enum opcodes and types are covered in switch statements.
1. xtypes v1.3 specification, 7.3.2 XML Type Representation, Design rationale, the XML specification should be just a direct translation from the IDL specification, therefore the IDL specification should apply 2. IDL v4.2 specification, 7.4.2 Keywords, "default" is a default keyword, and any identifiers that collide with a keyword are illegal, e.g. boolean is a valid keyword, Boolean and BooLean would be illegal identifiers 3. IDL v4.2 specification, 7.4.1.4.4.4.3 Enumerations, enumerators are classified as identifiers Therefore an enum with a literal named "default" would be an illegal enum and there would be a problem somewhere else in Cyclone for not catching it
6576c53 to
7016737
Compare
e6e79c0 to
0a4345d
Compare
Discriminant values outside the 32-bit range are not supported yet and IDLC probably has some issues, but it mostly works
The generated union discriminator labels for negative 8- and 16-bit discriminants were incompatible with the (de)serializer because the former sign extended them, whereas the latter did not. The way this sign extension was done furthermore caused compile-time warnings for implicit conversion of signed to unsigned. It could easily be fixed by also performing the sign extension in the (de)serializer, but not doing that has a small run-time benefit and results in slightly simpler code. As these cases didn't work at all before, it is a reasonable assumption that no-one would benefit from keeping the generated code unchanged.
This only provides an API function for setting the key flag on the union. The typebuilder code doesn't yet support generating a topic descriptor for this.
This allows defining multiple modules or multiple types at top-level in a single XML file.
These functions store the created serdata in an out-parameter and return a proper error code. (On error, the output pointer is set to NULL.) The functions that return a pointer now wrap these new ones and always return NULL on any failure. This means that the ugly DDSI_SERDATA_FROM_SER_DISCARD macro is now entirely opt-in for the serdata implementation and no longer relevant for the rest of the code.
This adds a check to prevent overflow of the multiplication of sequence length and element size. While it can't overflow given the small factors between in-memory and CDR sizes, the limited input sizes and the code checking that the sequence length is bounded by the remaining bytes of the input, the conditions may change in the future.
The "unable to deliver strategy" enum symbols used to be DISCARD_SAMPLE and BLOCK, but have been remained (in 0.8.999) to DISCARD_DATA and RETRY_UNTIL_DELIVERED.
0a4345d to
f5bbdf8
Compare
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.
It also fixes some things discovered in the process:
AUTO