roscpp_core icon indicating copy to clipboard operation
roscpp_core copied to clipboard

Conversion from size_t to uint32_t in vector serialization

Open csorvagep opened this issue 5 years ago • 0 comments

In roscpp_serialization/include/ros/serialization.h:417 v.size() returns with size_t and the serializedLength returns with uint32_t. size_t on 64-bit systems usually 64 bit wide, so this line cause a warning. (I noticed this on windows, where some warnings are enabled by default.)

The proper return type should be size_t, but since size_of(T) is already converted to uint32_t, this can be fixed with another static cast.

I can create a pull request if needed.

csorvagep avatar Jan 31 '21 17:01 csorvagep