]> git.proxmox.com Git - mirror_qemu.git/commit - qga/vss-win32/install.cpp
qga/vss-win32: fix warning for clang++-15
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Tue, 21 Feb 2023 15:30:05 +0000 (16:30 +0100)
committerKostiantyn Kostiuk <kostyanf14@live.com>
Wed, 22 Mar 2023 19:02:09 +0000 (21:02 +0200)
commit0fcd574b025fccdf14d5140687cafe2bc30b634f
tree83ae1a74127216c71203f77314906855df8e6e74
parent9832009d9dd2386664c15cc70f6e6bfe062be8bd
qga/vss-win32: fix warning for clang++-15

Reported when compiling with clang-windows-arm64.

../qga/vss-win32/install.cpp:537:9: error: variable 'hr' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
    if (!(ControlService(service, SERVICE_CONTROL_STOP, NULL))) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../qga/vss-win32/install.cpp:545:12: note: uninitialized use occurs here
    return hr;
           ^~

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Fixes: 917ebcb170 ("qga-win: Fix QGA VSS Provider service stop failure")
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Kostiantyn Kostiuk <kostyanf14@live.com>
qga/vss-win32/install.cpp