We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Required Info:
The code in question is here:
rosidl/rosidl_typesupport_introspection_cpp/resource/msg__type_support.cpp.em
Lines 70 to 71 in 075fe35
Fixed size arrays are getting resolved to std::array<T, N>, however the getter function inside the introspection code access the elements via a reinterpret_cast<T *>, which is potentially unsafe to do. More info here: https://stackoverflow.com/questions/39376813/is-the-stdarray-bit-compatible-with-the-old-c-array/39379359#39379359
std::array<T, N>
reinterpret_cast<T *>
This came out during dev time of rosbag2: ros2/rosbag2#56 (comment)
Does it make sense to cast it to an std::array<T, N> before accessing the element?
Cast to T *
T *
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug report
Required Info:
Steps to reproduce issue
The code in question is here:
rosidl/rosidl_typesupport_introspection_cpp/resource/msg__type_support.cpp.em
Lines 70 to 71 in 075fe35
Fixed size arrays are getting resolved to
std::array<T, N>
, however the getter function inside the introspection code access the elements via areinterpret_cast<T *>
, which is potentially unsafe to do.More info here:
https://stackoverflow.com/questions/39376813/is-the-stdarray-bit-compatible-with-the-old-c-array/39379359#39379359
This came out during dev time of rosbag2:
ros2/rosbag2#56 (comment)
Expected behavior
Does it make sense to cast it to an
std::array<T, N>
before accessing the element?Actual behavior
Cast to
T *
The text was updated successfully, but these errors were encountered: