OpenDDS / OpenDDS/OpenDDS

Using octet disc. in union results in opendds_idl compile error

Open
#4,794 9 comments 0 reactions 0 assignees View on GitHub

@jrw972 is already working on this.

Since Sep 12, 2024.

  • #4797 by @jrw972 — open
Dominant language
C++
Stars
1.5k
Forks
516
Avg merge
4d 4h
Merged PRs (30d)
4

Description

When using @optional with a union opendds_idl gives an error

Test file:

union TestUnion_Octet switch(octet) {
  case 1:
    @optional short FirstCase;
  default:
    @optional long myinft;
};

Compiled using:

opendds_idl -Sa -St --no-dcps-data-type-warnings -Lc++11 --no-default-nested -Gxtypes-complete optional.idl

Results in the error

Error - /home/johnny/ACE/OpenDDS/bin/opendds_idl: "optional.idl", line 7: Unhandled ExprType value in generateDefaultValue
Fatal Error - Aborting

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the optional.idl reproducer and run the provided opendds_idl command to confirm the generateDefaultValue error for an octet-switched union. Trace the IDL compiler path handling @optional union members and inspect linked pull request #4797 before making changes. Done means the reproducer compiles without the fatal error and has regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.