IDL enum issues - Same enumerator names, and a value specified [13812] #235
Replies: 3 comments
-
I use the gen program of version 2.0.0 and use @ value to specify the default value of enum, but the actual value is 0, 1, 2 and 3; Has this problem been solved. enum Enumeration |
Beta Was this translation helpful? Give feedback.
-
Hi @webhoppery, As @zip-link comment states, the proper way defined by the OMG IDL specification to set specific values into an Enumerator is using the builtin annotation However, @zip-link is right and this builtin annotation is not yet supported in Fast DDS-Gen. I have just issued eProsima/Fast-DDS-docs#368 to clarify this point in the documentation. And I will leave this issue open until |
Beta Was this translation helpful? Give feedback.
-
Labeling this ticket as an enhancement as it is something not yet supported (though defined in the specification). Moving the ticket to the Ideas discussion forum where enhancements and feature requests are discussed. |
Beta Was this translation helpful? Give feedback.
-
Example : Test.idl (Test.txt attached)
Errors with : UNKNOWN = 0,
Had to Edit : UNKNOWN , // = 0,
Same enumerator names - UNKNOWN
cmake ..
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.30.30706.0
cmake --build .
Test.cxx(44,46): error C2365: 'orov::msg::system::UNKNOWN': redefinition; previous definition was 'enumerator'
Test.h : Edit enum to enum class
Test.cxx(46,47): error C2065: 'UNKNOWN': undeclared identifier
Test.cxx : Prefix UNKNOWN with enum name ::
m_crc_result = orov::msg::system::EChecksumResult::UNKNOWN;
m_reset_cause = orov::msg::system::EMCUResetCause::UNKNOWN;
But other statements prefix with the enum name :
Test.txt
Could fastddsgen assume the enum is enum class and prefix UNKNOWN?
Beta Was this translation helpful? Give feedback.
All reactions