qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 3/4] qga/vss-win32: fix warning for clang++-15


From: Pierrick Bouvier
Subject: Re: [PATCH v4 3/4] qga/vss-win32: fix warning for clang++-15
Date: Tue, 21 Mar 2023 22:48:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

Sorry to come back on this, but it seems this specific commit was not integrated in trunk.

@Konstantin Kostiuk: If you plan to integrate this later (before 8.0 tag), sorry for the noise. Since rc1 was published today, I think it may have been "lost".

If someone wants to merge it, that would be nice.

Thanks,
Pierrick

On 2/21/23 16:30, Pierrick Bouvier wrote:
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>
---
  qga/vss-win32/install.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index b57508fbe0..b8087e5baa 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -518,7 +518,7 @@ namespace _com_util
  /* Stop QGA VSS provider service using Winsvc API  */
  STDAPI StopService(void)
  {
-    HRESULT hr;
+    HRESULT hr = S_OK;
      SC_HANDLE manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
      SC_HANDLE service = NULL;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]