aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJuro Bystricky <juro.bystricky@intel.com>2021-11-29 14:09:32 +0000
committerAlex Bennée <alex.bennee@linaro.org>2021-11-29 15:13:22 +0000
commitd5615bbf9103f01911df683cc3e4e85c49a92593 (patch)
tree681e9db18c2407fbeb42dc127faa8f2cbb198da9 /tests
parent1e970158be18ed1142a8ba996448113f90848aa4 (diff)
downloadqemu-d5615bbf9103f01911df683cc3e4e85c49a92593.zip
qemu-d5615bbf9103f01911df683cc3e4e85c49a92593.tar.gz
qemu-d5615bbf9103f01911df683cc3e4e85c49a92593.tar.bz2
tests/plugin/syscall.c: fix compiler warnings
Fix compiler warnings. The warnings can result in a broken build. This patch fixes warnings such as: In file included from /usr/include/glib-2.0/glib.h:111, from ../tests/plugin/syscall.c:13: ../tests/plugin/syscall.c: In function ‘print_entry’: /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘out’ may be used uninitialized in this function [-Werror=maybe-uninitialized] g_free (*pp); ^~~~~~~~~~~~ ../tests/plugin/syscall.c:82:23: note: ‘out’ was declared here g_autofree gchar *out; ^~~ In file included from /usr/include/glib-2.0/glib.h:111, from ../tests/plugin/syscall.c:13: ../tests/plugin/syscall.c: In function ‘vcpu_syscall_ret’: /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘out’ may be used uninitialized in this function [-Werror=maybe-uninitialized] g_free (*pp); ^~~~~~~~~~~~ ../tests/plugin/syscall.c:73:27: note: ‘out’ was declared here g_autofree gchar *out; ^~~ cc1: all warnings being treated as errors Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20211128011551.2115468-1-juro.bystricky@intel.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20211129140932.4115115-9-alex.bennee@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/plugin/syscall.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/plugin/syscall.c b/tests/plugin/syscall.c
index 484b48d..96040c5 100644
--- a/tests/plugin/syscall.c
+++ b/tests/plugin/syscall.c
@@ -70,19 +70,17 @@ static void vcpu_syscall_ret(qemu_plugin_id_t id, unsigned int vcpu_idx,
}
g_mutex_unlock(&lock);
} else {
- g_autofree gchar *out;
- out = g_strdup_printf("syscall #%" PRIi64 " returned -> %" PRIi64 "\n",
- num, ret);
+ g_autofree gchar *out = g_strdup_printf(
+ "syscall #%" PRIi64 " returned -> %" PRIi64 "\n", num, ret);
qemu_plugin_outs(out);
}
}
static void print_entry(gpointer val, gpointer user_data)
{
- g_autofree gchar *out;
SyscallStats *entry = (SyscallStats *) val;
int64_t syscall_num = entry->num;
- out = g_strdup_printf(
+ g_autofree gchar *out = g_strdup_printf(
"%-13" PRIi64 "%-6" PRIi64 " %" PRIi64 "\n",
syscall_num, entry->calls, entry->errors);
qemu_plugin_outs(out);