From: Simon McVittie Date: Mon, 25 Sep 2017 15:19:39 +0000 (+0100) Subject: dbus-send: Reassure the compiler that secondary_type is initialized X-Git-Tag: dbus-1.10.24~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b623b65c65d979a6a2c4d2e0efcfaf7f045f6cc;p=thirdparty%2Fdbus.git dbus-send: Reassure the compiler that secondary_type is initialized It's initialized to a non-trivial value whenever container_type is DBUS_TYPE_DICT_ENTRY, and subsequently only used if container_type is DBUS_TYPE_DICT_ENTRY, but Debian's gcc 7.2.0-7 doesn't seem to be able to infer that any more, causing build failure under -Werror=maybe-uninitialized. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102979 Reviewed-by: Philip Withnall --- diff --git a/tools/dbus-send.c b/tools/dbus-send.c index 0dc1f5b35..235e58e57 100644 --- a/tools/dbus-send.c +++ b/tools/dbus-send.c @@ -464,6 +464,7 @@ main (int argc, char *argv[]) DBusMessageIter container_iter; type = DBUS_TYPE_INVALID; + secondary_type = DBUS_TYPE_INVALID; arg = argv[i++]; c = strchr (arg, ':'); @@ -544,6 +545,7 @@ main (int argc, char *argv[]) } else if (container_type == DBUS_TYPE_DICT_ENTRY) { + _dbus_assert (secondary_type != DBUS_TYPE_INVALID); append_dict (target_iter, type, secondary_type, c); } else