Build fix: missing initializer for member 'payload'
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 16 Jun 2022 21:36:41 +0000 (17:36 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Jun 2022 14:56:44 +0000 (10:56 -0400)
gcc 5.4.0 complains that:
error-query.cpp:777:2: warning: missing initializer for member '{anonymous}::lttng_error_query_comm::payload' [-Wmissing-field-initializers]

The structure's members are initialized one by one.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I1264bc2da7e8ff6ec6c740341a381b33bae643d1

src/common/error-query.cpp

index 1444be1750e5542c24504fefd052783f21e0eab3..d3831ae81b86bf6c509c42818119fc937394cde2 100644 (file)
@@ -772,9 +772,9 @@ int lttng_error_query_serialize(const struct lttng_error_query *query,
                struct lttng_payload *payload)
 {
        int ret;
-       const struct lttng_error_query_comm header = {
-               .target_type = (decltype(header.target_type)) query->target_type,
-       };
+       struct lttng_error_query_comm header;
+
+       header.target_type = (decltype(header.target_type)) query->target_type;
 
        ret = lttng_dynamic_buffer_append(
                        &payload->buffer, &header, sizeof(header));
This page took 0.02604 seconds and 4 git commands to generate.