From: Daniel P. Berrangé Date: Thu, 12 Mar 2020 18:39:35 +0000 (+0000) Subject: util: ensure min/maj are initialized in virGetDeviceID X-Git-Tag: v6.2.0-rc1~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a815baf2f53cbd73fd4f96b203762dee1bf73f9;p=thirdparty%2Flibvirt.git util: ensure min/maj are initialized in virGetDeviceID The stub impl of virGetDeviceID just returns ENOSYS and does not initialize the min/maj output parameters. This lead to a false positive warning on mingw about possible use of uninitialized variables. Reviewed-by: Ján Tomko Signed-off-by: Daniel P. Berrangé --- diff --git a/src/util/virutil.c b/src/util/virutil.c index f77ee05dbf..ddd8805101 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -1407,9 +1407,10 @@ virGetDeviceID(const char *path, int *maj, int *min) #else int virGetDeviceID(const char *path G_GNUC_UNUSED, - int *maj G_GNUC_UNUSED, - int *min G_GNUC_UNUSED) + int *maj, + int *min) { + *maj = *min = 0; return -ENOSYS; } #endif