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-Tag: v2.12.0-rc2~71 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;ds=sidebyside;h=62a101ce513dbea31f5a8fdd8ed1c23e417eb553;p=lttng-tools.git 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; }