-
Notifications
You must be signed in to change notification settings - Fork 62
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
Compile error when using -typeobject in fastddsgen #158
Comments
Hello @NeilTruter Thanks for the report. Following the contributing guidelines, this issue has been moved to the Fast DD-Gen repository. Please, try this and let us know if it does not allow you to compile either. |
I ran into this issue as well, it seems to be an issue when compiling with C++20, I setup a small demo here: https://github.com/tmayoff/eprosima-test/tree/endianness, added the |
Another note this seems to just be a problem when compiling with clang++, where as g++ looks fine |
I have this problem on both Windows and Ubuntu using Qt and compiling with MSVC on Windows and gcc on Ubuntu |
I did some testing now and experiencing the same. |
Is there an already existing issue for this?
Expected behavior
Successful compile of code when specifying -typeobject when using fastddsgen
Current behavior
When specifying '-typeobject' for fastddsgen, and then compiling my project I receive the error below.
Omitting '-typeobject' from fastddsgen my project compiles without error.
/usr/local/include/fastcdr/Cdr.h:1381: error: ambiguous overload for ‘operator==’ (operand types are ‘uint8_t’ {aka ‘unsigned char’} and ‘eprosima::fastcdr::Cdr::Endianness’)
In file included from /home/user/Projects/Generic/Libs/Omnibus/generated/Alarm.cxx:31:
/usr/local/include/fastcdr/Cdr.h: In member function ‘eprosima::fastcdr::Cdr& eprosima::fastcdr::Cdr::serialize(const std::vector&, eprosima::fastcdr::Cdr::Endianness)’:
/usr/local/include/fastcdr/Cdr.h:1381:53: error: ambiguous overload for ‘operator==’ (operand types are ‘uint8_t’ {aka ‘unsigned char’} and ‘eprosima::fastcdr::Cdr::Endianness’)
1381 | m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
| ~~~~~~~~~~~~ ^~ ~~~~~~~~~~
| | |
| | eprosima::fastcdr::Cdr::Endianness
| uint8_t {aka unsigned char}
/usr/local/include/fastrtps/types/TypeObject.h:18: In file included from /usr/local/include/fastrtps/types/TypeObject.h:18,
In file included from /usr/local/include/fastrtps/types/TypeObject.h:18,
from /home/user/Projects/Generic/Libs/Omnibus/generated/AlarmTypeObject.h:26,
from /home/user/Projects/Generic/Libs/Omnibus/generated/Alarm.cxx:30:
/usr/local/include/fastrtps/types/TypesBase.h:251:1: note: candidate: ‘typename std::enable_if<(std::is_arithmetic<_Tp>::value || std::is_enum<_Tp>::value), bool>::type eprosima::fastrtps::types::operator==(T, const eprosima::fastrtps::types::ReturnCode_t&) [with T = eprosima::fastcdr::Cdr::Endianness; typename std::enable_if<(std::is_arithmetic<_Tp>::value || std::is_enum<_Tp>::value), bool>::type = bool]’ (reversed)
251 | operator ==(
| ^~~~~~~~
/home/user/Projects/Generic/Libs/Omnibus/generated/Alarm.cxx:31: In file included from /home/user/Projects/Generic/Libs/Omnibus/generated/Alarm.cxx:31:
In file included from /home/user/Projects/Generic/Libs/Omnibus/generated/Alarm.cxx:31:
/usr/local/include/fastcdr/Cdr.h:1381:53: note: candidate: ‘operator==(int, int)’ (built-in)
1381 | m_swapBytes = (m_swapBytes && (m_endianness == endianness)) || (!m_swapBytes && (m_endianness != endianness));
| ~~~~~~~~~~~~~^~~~~~~~~~~~~
Steps to reproduce
Use -typeobject with fastddsgen and compile the generated source into your own project.
Fast DDS version/commit
Latest, 2.9.1
Platform/Architecture
Windows 10 Visual Studio 2019, Other. Please specify in Additional context section.
Transport layer
Default configuration, UDPv4 & SHM
Additional context
Problem exists on both Windows 10 and Ubuntu 22.04.1 LTS.
Using QtCreator to compile code.
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: