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

Generating idl with -typeobject and including a header with typdefs causes c++ compilations errors. #163

Open
tmayoff opened this issue Mar 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@tmayoff
Copy link

tmayoff commented Mar 13, 2023

We have an idl file that's used to define some typedefs that most if not all our other IDL files include. However when running fastddsgen with -typeobject (which I believe we need to be able to use Content Filtered Topics), we get this as the errors

FAILED: eprosima_test.p/meson-generated_.._TestTypeObject.cxx.o 
/usr/bin/g++ -Ieprosima_test.p -I. -I.. -I/usr/include -I/usr/include/foonathan_memory -I/usr/include/x86_64-linux-gnu/foonathan_memory -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c++17 -O0 -g -DFASTRTPS_DYN_LINK -DFOONATHAN_MEMORY=1 -DTINYXML2_IMPORT -MD -MQ eprosima_test.p/meson-generated_.._TestTypeObject.cxx.o -MF eprosima_test.p/meson-generated_.._TestTypeObject.cxx.o.d -o eprosima_test.p/meson-generated_.._TestTypeObject.cxx.o -c TestTypeObject.cxx
In file included from TestTypeObject.cxx:28:
TestTypeObject.h:58:47: error: default argument given for parameter 1 of ‘const eprosima::fastrtps::types::TypeIdentifier* GetMACHINEIDIdentifier(bool)’ [-fpermissive]
   58 | eProsima_user_DllExport const TypeIdentifier* GetMACHINEIDIdentifier(bool complete = false);
      |                                               ^~~~~~~~~~~~~~~~~~~~~~
In file included from TestTypeObject.h:25:
TestIncludeTypeObject.h:57:47: note: previous specification in ‘const eprosima::fastrtps::types::TypeIdentifier* GetMACHINEIDIdentifier(bool)’ here
   57 | eProsima_user_DllExport const TypeIdentifier* GetMACHINEIDIdentifier(bool complete = false);
      |                                               ^~~~~~~~~~~~~~~~~~~~~~
TestTypeObject.h:59:43: error: default argument given for parameter 1 of ‘const eprosima::fastrtps::types::TypeObject* GetMACHINEIDObject(bool)’ [-fpermissive]
   59 | eProsima_user_DllExport const TypeObject* GetMACHINEIDObject(bool complete = false);
      |                                           ^~~~~~~~~~~~~~~~~~
TestIncludeTypeObject.h:58:43: note: previous specification in ‘const eprosima::fastrtps::types::TypeObject* GetMACHINEIDObject(bool)’ here
   58 | eProsima_user_DllExport const TypeObject* GetMACHINEIDObject(bool complete = false);
      |                                           ^~~~~~~~~~~~~~~~~~
[5/6] Compiling C++ object eprosima_test.p/meson-generated_.._TestPubSubTypes.cxx.o
ninja: build stopped: subcommand failed.

A solution around this is to place the typedefs in an IDL module, but it would be nice to not need to do that.

A test project can be found here: https://github.com/tmayoff/eprosima-test

@MRicoIE2CS MRicoIE2CS added triage question Further information is requested need more info More information is required to reproduce and removed triage need more info More information is required to reproduce labels Mar 16, 2023
@MRicoIE2CS
Copy link

MRicoIE2CS commented Mar 17, 2023

Hi @tmayoff,
I have been able to reproduce your issue.
When trying to compile the files generated using -typeobject flag, the compiles throws the lines stated in the issue.
It happens with an idl including another idl which have a typedef.
We will try to assign resources to resolve this issue.
Thank you for the report.

@MRicoIE2CS MRicoIE2CS added bug Something isn't working and removed question Further information is requested labels Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants