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

Invalid IDL files generated when IDL reserved keywords are used as field name #740

Open
achim-k opened this issue Apr 12, 2023 · 1 comment
Labels
backlog bug Something isn't working

Comments

@achim-k
Copy link

achim-k commented Apr 12, 2023

Bug report

Invalid IDL files are generated when IDL reserved keywords are used as field name.

Consider the generated action_tutorials_interfaces/Fibonanni.idl:

    struct Fibonacci_Result {
      sequence<int32> sequence;
    };

sequence cannot be used as the field name as it is a reserved keyword (see https://www.omg.org/spec/IDL/4.2/PDF, page 29 for a list of all keywords)

Required Info:

  • Operating System: Ubuntu 22.04
  • Installation type: Binaries
  • Version or commit hash: 3.1.4-1jammy.20230112.141540
  • DDS implementation: N/A
  • Client library (if applicable): N/A

Steps to reproduce issue

  1. Build action_tutorials_interfaces (or install from binaries)
  2. Confirm that the generated Fibonacci.idl file is invalid as it uses the reserved keyword sequence

Expected behavior

IDL generation from msg/srv/action files which use reserved IDL keywords as field names should fail. Parsing for invalid IDL files should also fail.

Actual behavior

IDL generation succeeds

@clalancette
Copy link
Contributor

We discussed this, and what we should have is a check in rosidl_parser to check for this situation early on.

Once we have this detection, there is a design decision to make about what we do in response. We could rename the field (add an _ or something), but that has downstream effects. We could add an IDL annotation to help with that. Or we could reject it out-of-hand and make the user fix it.

While this is definitely a bug, I'm going to put it on our backlog since we probably won't look at this soon.

@clalancette clalancette added bug Something isn't working backlog labels Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants