Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDL4 expanded usage of anonymous sequence/array #1931

Open
jwillemsen opened this issue Oct 7, 2020 · 1 comment
Open

IDL4 expanded usage of anonymous sequence/array #1931

jwillemsen opened this issue Oct 7, 2020 · 1 comment

Comments

@jwillemsen
Copy link
Member

See https://stackoverflow.com/questions/64233975/opendds-idl-sequence-type, the following construct leads to non compilable code. It does use an anonymous type which tao_idl front end doesn't warn for, ridlc does reject it

typedef sequence<octet> Pixels[2];
module message {
  @topic
  struct Image {
    unsigned short width;
    unsigned short height;
    unsigned short bytesPerPixel;
    Pixels data;
  };
};

Compile error:

testTypeSupportImpl.cpp: In function ‘bool OpenDDS::DCPS::gen_skip_over(OpenDDS::DCPS::Serializer&, Pixels_forany*)’:
testTypeSupportImpl.cpp:83:41: error: ‘sequence’ does not name a type; did you mean ‘servent’?
     if (!gen_skip_over(ser, static_cast<sequence*>(0))) return false;

ridl correct error output

IDL::ParseError: Anonymous type definitions are not allowed!
    t4.idl: line 1, column 34
@mitza-oci
Copy link
Member

IDL4 support is incomplete. It's a work in progress.

The Developer's Guide for 3.15 will describe what's supported and what's not. The short answer is that using an anonymous sequence/array that's directly contained in a struct will work. Other cases probably won't.

The reason for this is that there are use cases where a code generator writes the IDL, not a user. That particular kind of IDL needs to be accepted. When it's the user directly writing it then that user can use typedef as in IDL3.

@mitza-oci mitza-oci changed the title IDL construct causes non compilable code IDL4 expanded usage of anonymous sequence/array Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants