From: Jérémie Galarneau Date: Fri, 5 Mar 2021 16:10:38 +0000 (-0500) Subject: spawn-viewer: silence bogus warning on gcc 5.4.0 PPC32 X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=a825ed8c13767073d0976c3cba8394a96bcb0e4d spawn-viewer: silence bogus warning on gcc 5.4.0 PPC32 gcc 5.4.0 warns that saveptr is used uninitialized, but the use here with strtok_r is fine, as documented in STRTOK(3). `saveptr` is merely used as a return value when `str` is non-NULL. Signed-off-by: Jérémie Galarneau Change-Id: I1e47cb633f09978ebf9159f07dfacb8bef27a616 --- diff --git a/src/common/spawn-viewer.c b/src/common/spawn-viewer.c index 1d668157f..4ca0ce1a2 100644 --- a/src/common/spawn-viewer.c +++ b/src/common/spawn-viewer.c @@ -69,7 +69,7 @@ static char **alloc_argv_from_user_opts(char *opts, const char *trace_path) { int i = 0, ignore_space = 0; unsigned int num_opts = 1; - char **argv, *token = opts, *saveptr; + char **argv, *token = opts, *saveptr = NULL; /* Count number of arguments. */ do {