From dd49e13f4a9eddfda119f7bc9dbb1d836689eaad Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sat, 5 Sep 2015 11:44:01 -0400 Subject: [PATCH] Silence undefined return value warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit clang-analyzer complains that "ret" may be returned uninitialized which can't happen with a valid session configuration. For this to occur, either libxml2 would have to return a bogus ChildElementCount (return non-zero when there a actually no child nodes) _or_ the node would have children of an unexpected type, which would be catched by the validation performed against the XSD. Nonetheless, the value is initialized here to silence this warning. Signed-off-by: Jérémie Galarneau --- src/common/config/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/config/config.c b/src/common/config/config.c index 48dc0b034..6834d7a54 100644 --- a/src/common/config/config.c +++ b/src/common/config/config.c @@ -2115,7 +2115,7 @@ static int process_pid_tracker_node(xmlNodePtr pid_tracker_node, struct lttng_handle *handle) { - int ret, child; + int ret = 0, child; xmlNodePtr targets_node = NULL; xmlNodePtr node; -- 2.34.1