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
|
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_casted 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 *?
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
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> *isreinterpret_casted to astd::vector<unsigned char> *with avoid *as intermediate. IMHO this is not guaranteed to work by the C++ standard as implementations are allowed to use different template specializations ofstd::vectorfor different types. There are only guarantees for the memory layout of a vectorsdata().As far as I can tell the above code is only the symptom as the
void * fieldhere is part of what is passed intormw_serializeasros_message. Maybe it would be better to pass only thedata()pointer of the vector at some point instead of the whole vector asvoid *?