Uninitialized member in ros::AdvertiseOptions
peci1 opened this issue · 0 comments
peci1 commented
ros_comm/clients/roscpp/include/ros/advertise_options.h
Lines 43 to 47 in f1156c1
Field has_header
is of trivial type and the no-arg constructor does not initialize it. This has hit me with a hard-to-debug issue when creating advertiseoptions myself not using the all-arg constructor. If you create AdvertiseOptions
using the no-arg constructor, has_header
gets a random value and the code path in Publication
tries to increment the seq
field even if the message does not have a header.
Would a PR adding the missing initializer be accepted in Melodic and Noetic? I think adding an initializer should not break ABI or API.