Fix: lttng-sessiond: control reaches end of non-void function warning
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 5 Feb 2020 16:41:23 +0000 (11:41 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Feb 2020 21:04:45 +0000 (16:04 -0500)
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 <francis.deslauriers@efficios.com>
Change-Id: I0b596d328bc38183f21bd3a6f8419a63207953f3
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/tracker.c

index 302971767742a41f792f907484e2e91bc10e9c7f..cff5af3a0612c750a431fea74e435fd0d5c89591 100644 (file)
@@ -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;
        }
This page took 0.025972 seconds and 4 git commands to generate.