From: Francis Deslauriers Date: Wed, 5 Feb 2020 16:41:23 +0000 (-0500) Subject: Fix: lttng-sessiond: control reaches end of non-void function warning X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=11bd9cb470017f9934c25aeb77019ccee0e49e3c Fix: lttng-sessiond: control reaches end of non-void function warning Fixes the following error when building with GCC 7.4.0 with the following CFLAGS: "-g -fsanitize=address": tracker.c: In function ‘lttng_tracker_id_lookup_string’: tracker.c:405:1: error: control reaches end of non-void function [-Werror=return-type] } ^ At first glance, this seems like a false positive. I don't see how we can reach the end of the function without passing by a return statement. Even considering that, removing the `break` statement makes sense because it's superfluous. Signed-off-by: Francis Deslauriers Change-Id: I0b596d328bc38183f21bd3a6f8419a63207953f3 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/tracker.c b/src/bin/lttng-sessiond/tracker.c index 302971767..cff5af3a0 100644 --- a/src/bin/lttng-sessiond/tracker.c +++ b/src/bin/lttng-sessiond/tracker.c @@ -398,7 +398,6 @@ int lttng_tracker_id_lookup_string(enum lttng_tracker_type tracker_type, default: return LTTNG_ERR_INVALID; } - break; default: return LTTNG_ERR_INVALID; }