[PATCH 0/4] Appease Clang

Michal Privoznik mprivozn at redhat.com
Wed Aug 25 12:54:55 UTC 2021

With its recent update Clang-13.0.1-rc1 started to report spurious
warnings. Basically it is concerned about our use of g_auto*:

  g_autofree char *var = NULL;

  var = func();

It fails to see that @var is there to automatically free retval of
func(). I've reported the bug here:


But there are few places where we can change the code and appease Clang.
The rest, where our code is correct - I'm "fixing" those places in patch
4/4 which exists only to show that after the problematic pattern is
broken the build passes again:


Michal Prívozník (4):
  virpci: Avoid Clang false positive
  test: Drop unused @cfg from qemu*test
  virscsi: Drop @tmp from virSCSIDeviceListDel

 src/rpc/virnetclient.c             | 9 ++++++---
 src/util/viridentity.c             | 3 ++-
 src/util/virpci.c                  | 4 ++--
 src/util/virscsi.c                 | 3 +--
 tests/qemumigrationcookiexmltest.c | 2 --
 tests/qemustatusxml2xmltest.c      | 2 --
 6 files changed, 11 insertions(+), 12 deletions(-)


More information about the libvir-list mailing list