[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/13] test-logging: Fix -Werror=maybe-uninitialized warning
From: |
Thomas Huth |
Subject: |
[PULL 01/13] test-logging: Fix -Werror=maybe-uninitialized warning |
Date: |
Mon, 3 Feb 2020 13:37:59 +0100 |
From: Miroslav Rezanina <address@hidden>
Checking for uninitialized variables raises warning for file path
variables in test_logfile_write and test_logfile_lock functions.
To suppress this warning, initialize varibles to NULL. This is safe
change as result of g_build_filename is stored to them before any usage.
Signed-off-by: Miroslav Rezanina <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Robert Foley <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
---
tests/test-logging.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/test-logging.c b/tests/test-logging.c
index 1e646f045d..6387e4933f 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -114,8 +114,8 @@ static void test_logfile_write(gconstpointer data)
QemuLogFile *logfile2;
gchar const *dir = data;
Error *err = NULL;
- g_autofree gchar *file_path;
- g_autofree gchar *file_path1;
+ g_autofree gchar *file_path = NULL;
+ g_autofree gchar *file_path1 = NULL;
FILE *orig_fd;
/*
@@ -157,7 +157,7 @@ static void test_logfile_lock(gconstpointer data)
FILE *logfile;
gchar const *dir = data;
Error *err = NULL;
- g_autofree gchar *file_path;
+ g_autofree gchar *file_path = NULL;
file_path = g_build_filename(dir, "qemu_test_logfile_lock0.log", NULL);
--
2.18.1
- [PULL 00/13] qtests, kconfig and misc patches, Thomas Huth, 2020/02/03
- [PULL 02/13] tests/vhost-user-bridge: Fix build, Thomas Huth, 2020/02/03
- [PULL 01/13] test-logging: Fix -Werror=maybe-uninitialized warning,
Thomas Huth <=
- [PULL 03/13] docs/devel: Fix qtest paths and info about check-block in testing.rst, Thomas Huth, 2020/02/03
- [PULL 04/13] tests/Makefile: Fix inclusion of the qos dependency files, Thomas Huth, 2020/02/03
- [PULL 06/13] tests/qtest: update comments about bios-tables-test-allowed-diff.h, Thomas Huth, 2020/02/03
- [PULL 05/13] boot-order-test: fix memleaks in boot-order-test, Thomas Huth, 2020/02/03
- [PULL 08/13] hw/bt: Remove empty Kconfig file, Thomas Huth, 2020/02/03
- [PULL 09/13] hw/input: Do not enable CONFIG_PCKBD by default, Thomas Huth, 2020/02/03
- [PULL 07/13] gitlab-ci: Refresh the list of iotests, Thomas Huth, 2020/02/03
- [PULL 10/13] hw/hppa/Kconfig: LASI chipset requires PARALLEL port, Thomas Huth, 2020/02/03
- [PULL 12/13] include/sysemu/sysemu.h: Remove usused variable no_quit, Thomas Huth, 2020/02/03
- [PULL 13/13] trivial: Remove xenfb_enabled from sysemu.h, Thomas Huth, 2020/02/03