From 57fb67ac49ded29a2c1886529ae55f55999e5f71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 16 Jun 2022 17:36:41 -0400 Subject: [PATCH] Build fix: missing initializer for member 'payload' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc 5.4.0 complains that: channel.cpp:584:2: warning: missing initializer for member 'lttng_notification_channel_message::payload' [-Wmissing-field-initializers] The structure's members are initialized one by one. Signed-off-by: Jérémie Galarneau Change-Id: Ia5a5f37f6fe6977169771e4a298d1ce73ab74ea4 --- src/lib/lttng-ctl/channel.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/lttng-ctl/channel.cpp b/src/lib/lttng-ctl/channel.cpp index d1d92d00d..3613f1b1c 100644 --- a/src/lib/lttng-ctl/channel.cpp +++ b/src/lib/lttng-ctl/channel.cpp @@ -577,13 +577,13 @@ int handshake(struct lttng_notification_channel *channel) .major = LTTNG_NOTIFICATION_CHANNEL_VERSION_MAJOR, .minor = LTTNG_NOTIFICATION_CHANNEL_VERSION_MINOR, }; - struct lttng_notification_channel_message msg_header = { - .type = LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_HANDSHAKE, - .size = sizeof(handshake), - .fds = 0, - }; + struct lttng_notification_channel_message msg_header; char send_buffer[sizeof(msg_header) + sizeof(handshake)]; + msg_header.type = LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_HANDSHAKE; + msg_header.size = sizeof(handshake); + msg_header.fds = 0; + memcpy(send_buffer, &msg_header, sizeof(msg_header)); memcpy(send_buffer + sizeof(msg_header), &handshake, sizeof(handshake)); @@ -627,11 +627,11 @@ enum lttng_notification_channel_status send_condition_command( enum lttng_notification_channel_status status = LTTNG_NOTIFICATION_CHANNEL_STATUS_OK; struct lttng_payload payload; - struct lttng_notification_channel_message cmd_header = { - .type = (int8_t) type, - .size =0, - .fds = 0, - }; + struct lttng_notification_channel_message cmd_header; + + cmd_header.type = (int8_t) type; + cmd_header.size = 0; + cmd_header.fds = 0; lttng_payload_init(&payload); -- 2.34.1