Fix: g++ 4.8 doesn't support non-trivial designated initializers
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 18 Nov 2021 22:43:55 +0000 (17:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Nov 2021 23:34:27 +0000 (18:34 -0500)
GCC 4.8 doesn't support initializing a compound literal or an anonymous
structure with only empty brackets '{}'. Add members until it stops
complaining.

Change-Id: I22f05d3f8791e34da2618b0cae282da994c670f3
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/stream.cpp
src/common/payload-view.cpp

index 346936d8488f1436186f4b5abf065bf86131d2d7..b57c061c571b41fea32997d5c778eabee233764c 100644 (file)
@@ -71,7 +71,7 @@ static void stream_complete_rotation(struct relay_stream *stream)
        }
        lttng_trace_chunk_put(stream->trace_chunk);
        stream->trace_chunk = stream->ongoing_rotation.value.next_trace_chunk;
-       stream->ongoing_rotation = (typeof(stream->ongoing_rotation)) {};
+       stream->ongoing_rotation = LTTNG_OPTIONAL_INIT_UNSET;
        stream->completed_rotation_count++;
 }
 
index b1a44368da2001916b4f977d04865d5b2f97390a..3ea043c8aa0c7fb4a9051a890e020465f09d8636 100644 (file)
@@ -24,7 +24,10 @@ struct lttng_payload_view lttng_payload_view_from_payload(
                .buffer = lttng_buffer_view_from_dynamic_buffer(
                        &payload->buffer, offset, len),
                ._fd_handles = payload->_fd_handles,
-               } : (struct lttng_payload_view) {};
+       } : (struct lttng_payload_view) {
+               .buffer = {},
+               ._fd_handles = {}
+       };
 }
 
 struct lttng_payload_view lttng_payload_view_from_view(
@@ -39,7 +42,10 @@ struct lttng_payload_view lttng_payload_view_from_view(
                        .p_fd_handles_position = view->_iterator.p_fd_handles_position ?:
                                &view->_iterator.fd_handles_position,
                }
-       } : (struct lttng_payload_view) {};
+       } : (struct lttng_payload_view) {
+               .buffer = {},
+               ._fd_handles = {}
+       };
 }
 
 struct lttng_payload_view lttng_payload_view_from_dynamic_buffer(
@@ -48,8 +54,12 @@ struct lttng_payload_view lttng_payload_view_from_dynamic_buffer(
 {
        return buffer ? (struct lttng_payload_view) {
                .buffer = lttng_buffer_view_from_dynamic_buffer(
-                       buffer, offset, len)
-               } : (struct lttng_payload_view) {};
+                       buffer, offset, len),
+               ._fd_handles = {}
+       } : (struct lttng_payload_view) {
+               .buffer = {},
+               ._fd_handles = {}
+       };
 }
 
 struct lttng_payload_view lttng_payload_view_from_buffer_view(
@@ -58,8 +68,12 @@ struct lttng_payload_view lttng_payload_view_from_buffer_view(
 {
        return view ? (struct lttng_payload_view) {
                .buffer = lttng_buffer_view_from_view(
-                       view, offset, len)
-               } : (struct lttng_payload_view) {};
+                       view, offset, len),
+               ._fd_handles = {}
+       } : (struct lttng_payload_view) {
+               .buffer = {},
+               ._fd_handles = {}
+       };
 }
 
 struct lttng_payload_view lttng_payload_view_init_from_buffer(
@@ -67,7 +81,8 @@ struct lttng_payload_view lttng_payload_view_init_from_buffer(
 {
        return (struct lttng_payload_view) {
                .buffer = lttng_buffer_view_init(
-                       src, offset, len)
+                       src, offset, len),
+               ._fd_handles = {}
        };
 }
 
This page took 0.027075 seconds and 4 git commands to generate.