]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: add brief inline comment explaining the "reserved" field in the bus vtable... 20339/head
authorLennart Poettering <lennart@poettering.net>
Wed, 28 Jul 2021 18:44:49 +0000 (20:44 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 28 Jul 2021 18:44:49 +0000 (20:44 +0200)
Follow-up for: #20253

src/systemd/sd-bus-vtable.h

index 438c651cb28fb3130bfd2d3d771887085bd3099f..8b316fac5ac61e07c13f822024eb5c5cc4b76f15 100644 (file)
@@ -76,7 +76,10 @@ struct sd_bus_vtable {
                         const unsigned *vtable_format_reference;
                 } start;
                 struct {
-                        size_t reserved;
+                        /* This field exists only to make sure we have something to initialize in
+                         * SD_BUS_VTABLE_END in a way that is both compatible with pedantic versions of C and
+                         * C++. It's unused otherwise. */
+                        size_t _reserved;
                 } end;
                 struct {
                         const char *member;
@@ -190,7 +193,7 @@ struct sd_bus_vtable {
                 .flags = 0,                                             \
                 .x = {                                                  \
                         .end = {                                        \
-                                .reserved = 0,                          \
+                                ._reserved = 0,                         \
                         },                                              \
                 },                                                      \
         }