-
Notifications
You must be signed in to change notification settings - Fork 118
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
Question about handling of array messages #219
Comments
IMHO, if https://en.cppreference.com/w/cpp/language/reinterpret_cast -> Type aliasing |
@deeplearningrobotics exactly. From my understanding |
@richiprosima may I ask you to look at what it would take to fix this? |
@richiware: Could you take a look a this? Or is this covered under the standard? Chapter 3.10 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf ) |
I will try to make the changes next week.
↪ 2018-11-28 mié 22:32, deeplearningrobotics <notifications@github.com>:
…
@richiware: Could you take a look a this?
Or is this covered under the standard?
Chapter 3.10 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf )
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#219 (comment)
|
@richiware: There are a lot of |
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_cast
ed 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::vector
for 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 * field
here is part of what is passed intormw_serialize
asros_message
. Maybe it would be better to pass only thedata()
pointer of the vector at some point instead of the whole vector asvoid *
?The text was updated successfully, but these errors were encountered: