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:318:2: warning: missing initializer for member '{anonymous}::lttng_error_query_result_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: Ie194864415bc3bc32bda6b2ac17150bd3f163394

src/common/error-query.cpp

index 38265fe8bd0d0238e00b1ebbd8349304d59de8aa..b3904104a71d9547fc6906f97f14a596374b64ea 100644 (file)
@@ -311,11 +311,11 @@ int lttng_error_query_result_serialize(
                struct lttng_payload *payload)
 {
        int ret;
                struct lttng_payload *payload)
 {
        int ret;
-       struct lttng_error_query_result_comm header = {
-               .type = (uint8_t) result->type,
-               .name_len = (typeof(header.name_len)) strlen(result->name) + 1,
-               .description_len = (typeof(header.name_len)) strlen(result->description) + 1,
-       };
+       struct lttng_error_query_result_comm header;
+
+       header.type = (uint8_t) result->type;
+       header.name_len = (typeof(header.name_len)) strlen(result->name) + 1;
+       header.description_len = (typeof(header.name_len)) strlen(result->description) + 1;
 
        /* Header. */
        ret = lttng_dynamic_buffer_append(
 
        /* Header. */
        ret = lttng_dynamic_buffer_append(
This page took 0.026165 seconds and 4 git commands to generate.