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

Build breaks with GCC 13.1 #3514

Closed
1 task done
kistlin opened this issue May 12, 2023 · 3 comments
Closed
1 task done

Build breaks with GCC 13.1 #3514

kistlin opened this issue May 12, 2023 · 3 comments
Labels
triage Issue pending classification

Comments

@kistlin
Copy link

kistlin commented May 12, 2023

Is there an already existing issue for this?

  • I have searched the existing issues

Expected behavior

Build succeeds.

Current behavior

Fast-DDS-2.10.1/include/fastdds/rtps/transport/TransportDescriptorInterface.h:48:21: error: expected ‘)’ before ‘maximumMessageSize’
   48 |             uint32_t maximumMessageSize,
      |                     ^~~~~~~~~~~~~~~~~~~
      |                     )

...

In file included from Fast-DDS-2.10.1/src/cpp/dynamic-types/TypeNamesGenerator.cpp:1:
Fast-DDS-2.10.1/include/fastrtps/types/TypeNamesGenerator.h:17:13: error: ‘uint32_t’ has not been declared

Steps to reproduce

Build latest version with GCC 13.1+.

Fast DDS version/commit

Only tested with 2.10.1.

Platform/Architecture

Other. Please specify in Additional context section.

Transport layer

Default configuration, UDPv4 & SHM

Additional context

A sample patch to make it build again. I'm not sure about all supported compilers and platforms.
This one fixed it for GCC on Linux.

diff --git a/include/fastdds/rtps/transport/TransportDescriptorInterface.h b/include/fastdds/rtps/transport/TransportDescriptorInterface.h
index 149707736..30184d71a 100644
--- a/include/fastdds/rtps/transport/TransportDescriptorInterface.h
+++ b/include/fastdds/rtps/transport/TransportDescriptorInterface.h
@@ -17,7 +17,7 @@

 #include <fastrtps/fastrtps_dll.h>

-#ifdef _WIN32
+#if defined(_WIN32) || ((__GNUC__ >= 13) && (__GNUC_MINOR__ >= 1))
 #include <cstdint>
 #endif // ifdef _WIN32
 #include <vector>
diff --git a/include/fastrtps/types/TypeNamesGenerator.h b/include/fastrtps/types/TypeNamesGenerator.h
index a8f45e013..152933316 100644
--- a/include/fastrtps/types/TypeNamesGenerator.h
+++ b/include/fastrtps/types/TypeNamesGenerator.h
@@ -3,6 +3,9 @@

 #include <fastrtps/fastrtps_dll.h>

+#if defined(_WIN32) || ((__GNUC__ >= 13) && (__GNUC_MINOR__ >= 1))
+#include <cstdint>
+#endif // ifdef _WIN32
 #include <string>
 #include <vector>

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

@kistlin kistlin added the triage Issue pending classification label May 12, 2023
archlinux-github pushed a commit to archlinux/aur that referenced this issue May 12, 2023
@skrede
Copy link

skrede commented May 13, 2023

Removing the #ifdef altogether, like this
https://github.com/skrede/vcpkg/blob/master/ports/fast-dds/fix-uint32_t-does-not-name-type.patch
will also ensure there are no problems on MacOS

@kistlin
Copy link
Author

kistlin commented May 13, 2023

Assuming the #ifdef was there for a reason and previously the include only used on Windows.
Just removing it could break backwards compatibility.

@JLBuenoLopez
Copy link
Contributor

This has already been fixed in #3508 and backports have been ordered. The #ifdef seems to be some legacy code related to the MIN and MAX macros defined in Windows. This issue was dealt with some time ago so we don't think the backwards compatibility is going to be an issue. Thanks for your concern!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issue pending classification
Projects
None yet
Development

No branches or pull requests

3 participants