Re: [PATCH 2/2] lib: Use g_steal_pointer() more

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

 



On 3/24/21 3:51 PM, Peter Krempa wrote:
On Wed, Mar 24, 2021 at 11:27:07 +0100, Michal Privoznik wrote:
Generated by the following spatch:

   @@
   expression a, b;
   @@

   + b = g_steal_pointer(&a);
   - b = a;
     ... when != a
   - a = NULL;

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---

./dist-unpack/libvirt-7.2.0/src/rpc/virnetsocket.c:2159:10: error: pointer type mismatch ('virFreeCallback' (aka 'void (*)(void *)') and 'gpointer' (aka 'void *')) [-Werror,-Wpointer-type-mismatch]
     ff = g_steal_pointer(&sock->ff);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmem.h:217:6: note: expanded from macro 'g_steal_pointer'
   (0 ? (*(pp)) : (g_steal_pointer) (pp))
      ^ ~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

https://gitlab.com/libvirt/libvirt/-/jobs/1124093339


Okay, I blame glib. I don't know how to silence the error so I'll revert this particular hunk. Also, glib--. It's biting me more and more lately.

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux