-
Notifications
You must be signed in to change notification settings - Fork 127
Description
I am not sure whether this is the correct place for this issue. So please direct me to a better location.
Together with @Karsten1987 we stumbled over
rmw_fastrtps/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp
Line 279 in 8f6a13c
auto vector = reinterpret_cast<std::vector<unsigned char> *>(field); |
I have only limited understanding about the whole rmw. As far as I understand a array message member that is originally represented as a std::vector<T> *
is reinterpret_cast
ed to a std::vector<unsigned char> *
with a void *
as intermediate. IMHO this is not guaranteed to work by the C++ standard as implementations are allowed to use different template specializations of std::vector
for different types. There are only guarantees for the memory layout of a vectors data()
.
As far as I can tell the above code is only the symptom as the void * field
here is part of what is passed into rmw_serialize
as ros_message
. Maybe it would be better to pass only the data()
pointer of the vector at some point instead of the whole vector as void *
?