Clean-up: lttng: silence bogus warning
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 12 Feb 2021 18:34:47 +0000 (13:34 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 12 Feb 2021 18:36:31 +0000 (13:36 -0500)
clang warns that `name_search_ret` may be used unitiliazed if the domain
is none of {ust, python, log4j, jul}. However, those branches are only
accessible when one of these domains is used.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ibfea5be140a29a60ff8a60f0a994fcd815adb85d

src/bin/lttng/commands/enable_events.c

index 4b37a01aafa40e6a55dc3b45ab0dc914895fb6cd..570a3a6428cefaf132332996eefbb2aecd04ffa2 100644 (file)
@@ -919,7 +919,8 @@ static int enable_events(char *session_name)
 
                                        name_search_ret = loglevel_log4j_name_to_value(opt_loglevel, &loglevel);
                                        ev->loglevel = (int) loglevel;
-                               } else if (opt_python) {
+                               } else {
+                                       /* python domain. */
                                        enum lttng_loglevel_python loglevel;
 
                                        name_search_ret = loglevel_python_name_to_value(opt_loglevel, &loglevel);
@@ -1310,7 +1311,8 @@ static int enable_events(char *session_name)
 
                                        name_search_ret = loglevel_log4j_name_to_value(opt_loglevel, &loglevel);
                                        ev->loglevel = (int) loglevel;
-                               } else if (opt_python) {
+                               } else {
+                                       /* python domain. */
                                        enum lttng_loglevel_python loglevel;
 
                                        name_search_ret = loglevel_python_name_to_value(opt_loglevel, &loglevel);
This page took 0.033818 seconds and 4 git commands to generate.