From c7e8b256d236814f97bd76441b37e959a765e58c Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 13 Nov 2023 15:26:25 +0100 Subject: [PATCH] Fix gcc uninitialization warning confusion --- src/emu/system.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/emu/system.c b/src/emu/system.c index 31bfecf..05c480c 100644 --- a/src/emu/system.c +++ b/src/emu/system.c @@ -173,9 +173,8 @@ static int report_libovni_version(struct system *sys) { int mixed = 0; - int first = 1; - const char *version; - const char *commit; + const char *version = NULL; + const char *commit = NULL; for (struct thread *th = sys->threads; th; th = th->gnext) { if (th->meta == NULL) { err("thread has no metadata %s", th->id); @@ -196,11 +195,11 @@ report_libovni_version(struct system *sys) return -1; } - if (first) { + if (version == NULL) version = t_version; + + if (commit == NULL) commit = t_commit; - first = 0; - } if (strcmp(t_version, version) != 0) { warn("thread is using a different libovni version (%s): %s",