From eebf0bfcf5c2df19128bc1573dea971ba68d1c6b Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 1 Jan 2018 21:06:26 +0200 Subject: [PATCH] Linux SocketCAN: Missing initializer warning fix --- libuavcan_drivers/linux/include/uavcan_linux/socketcan.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libuavcan_drivers/linux/include/uavcan_linux/socketcan.hpp b/libuavcan_drivers/linux/include/uavcan_linux/socketcan.hpp index a9f645949d..ef3c727b23 100644 --- a/libuavcan_drivers/linux/include/uavcan_linux/socketcan.hpp +++ b/libuavcan_drivers/linux/include/uavcan_linux/socketcan.hpp @@ -61,7 +61,9 @@ class SocketCanIface : public uavcan::ICanIface { static inline ::can_frame makeSocketCanFrame(const uavcan::CanFrame& uavcan_frame) { - ::can_frame sockcan_frame { uavcan_frame.id& uavcan::CanFrame::MaskExtID, uavcan_frame.dlc, { } }; + ::can_frame sockcan_frame = ::can_frame(); + sockcan_frame.can_id = uavcan_frame.id & uavcan::CanFrame::MaskExtID; + sockcan_frame.can_dlc = uavcan_frame.dlc; (void)std::copy(uavcan_frame.data, uavcan_frame.data + uavcan_frame.dlc, sockcan_frame.data); if (uavcan_frame.isExtended()) {