summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-07-28 20:44:49 +0200
committerLennart Poettering <lennart@poettering.net>2021-07-28 20:44:49 +0200
commit0c4801738e83cb9c4a5e6fc5b24ed914a9496512 (patch)
tree119c6c151afe3a0732d43231404ced94519d6bb5 /src
parentsd-bus: fix indentation in macros (diff)
downloadsystemd-0c4801738e83cb9c4a5e6fc5b24ed914a9496512.tar.xz
systemd-0c4801738e83cb9c4a5e6fc5b24ed914a9496512.zip
sd-bus: add brief inline comment explaining the "reserved" field in the bus vtable structure
Follow-up for: #20253
Diffstat (limited to 'src')
-rw-r--r--src/systemd/sd-bus-vtable.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/systemd/sd-bus-vtable.h b/src/systemd/sd-bus-vtable.h
index 438c651cb2..8b316fac5a 100644
--- a/src/systemd/sd-bus-vtable.h
+++ b/src/systemd/sd-bus-vtable.h
@@ -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, \
}, \
}, \
}