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

Fixed warnings for ROS2 Humble #2

Open
wants to merge 1 commit into
base: ros2_master
Choose a base branch
from

Conversation

FranzAlbers
Copy link
Contributor

@FranzAlbers FranzAlbers commented Feb 2, 2023

In ROS2 Humble, you receive the following warnings when building the driver:

Starting >>> adma_ros2_driver
--- stderr: adma_ros2_driver                              
In file included from /home/albers/autoware/src/sensor_component/rst/adma_ros_driver/adma_ros2_driver/src/parser/adma2ros_parser_v32.cpp:3:
/opt/ros/humble/include/tf2_geometry_msgs/tf2_geometry_msgs/tf2_geometry_msgs.h:35:2: warning: #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead [-Wcpp]
   35 | #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead
      |  ^~~~~~~
In file included from /home/albers/autoware/src/sensor_component/rst/adma_ros_driver/adma_ros2_driver/src/parser/adma2ros_parser.cpp:3:
/opt/ros/humble/include/tf2_geometry_msgs/tf2_geometry_msgs/tf2_geometry_msgs.h:35:2: warning: #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead [-Wcpp]
   35 | #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead
      |  ^~~~~~~
In file included from /home/albers/autoware/src/sensor_component/rst/adma_ros_driver/adma_ros2_driver/src/parser/adma_parse_deprecated.cpp:8:
/opt/ros/humble/include/tf2_geometry_msgs/tf2_geometry_msgs/tf2_geometry_msgs.h:35:2: warning: #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead [-Wcpp]
   35 | #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead
      |  ^~~~~~~
In file included from /usr/include/string.h:535,
                 from /usr/include/c++/11/cstring:42,
                 from /home/albers/autoware/src/sensor_component/rst/adma_ros_driver/adma_ros2_driver/src/parser/adma_parse_deprecated.cpp:4:
In function ‘void* memcpy(void*, const void*, size_t)’,
    inlined from ‘void getgpsauxdata2(const string&, adma_msgs::msg::AdmaData&)’ at /home/albers/autoware/src/sensor_component/rst/adma_ros_driver/adma_ros2_driver/src/parser/adma_parse_deprecated.cpp:1255:11:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ reading 32 bytes from a region of size 4 [-Wstringop-overread]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/albers/autoware/src/sensor_component/rst/adma_ros_driver/adma_ros2_driver/src/parser/adma_parse_deprecated.cpp: In function ‘void getgpsauxdata2(const string&, adma_msgs::msg::AdmaData&)’:
/home/albers/autoware/src/sensor_component/rst/adma_ros_driver/adma_ros2_driver/src/parser/adma_parse_deprecated.cpp:1254:10: note: source object ‘gps_basenr’ of size 4
 1254 |     char gps_basenr[] = {local_data[498],local_data[499],local_data[500],local_data[501]};
      |          ^~~~~~~~~~
---
Finished <<< adma_ros2_driver [3.10s]

This PR fixes these warnings.
Since the tf2_geometry_msgs.hpp was introduced in Humble, this probably breaks the Galactic build (which could be moved to another branch).

@FranzAlbers FranzAlbers changed the title Fixed warnings Fixed warnings for ROS2 Humble Feb 2, 2023
@freak89dutch
Copy link
Collaborator

Thank you for your response. I also had these deprecated warnings with ROS2 Humble, but at the moment we don't have enough informations about the mostly used ROS distribution. We will discuss internaly which distribution will be our main one (master branch) and how to handle legacy versions. Until then, this PR will leaved open.

@FranzAlbers
Copy link
Contributor Author

Thanks for merging the other PRs!

ROS2 Galactic reached its end of life in December 2022, and Foxy will follow in May 2023 (https://docs.ros.org/en/rolling/Releases.html).

I propose to keep the main branch up to date for current distributions: Either for Humble as the current long-term-support version (until 2027) or for Rolling with an additional branch for Humble. This fix is necessary for both.

freak89dutch added a commit that referenced this pull request Aug 17, 2023
See PR #2 for the discussion...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants