[libvirt] [dbus PATCH] domain: remove G_GNUC_UNUSED for used attributes

Ján Tomko posted 1 patch 6 years ago
Failed in applying to current master (apply log)
src/domain.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[libvirt] [dbus PATCH] domain: remove G_GNUC_UNUSED for used attributes
Posted by Ján Tomko 6 years ago
A few functions use the G_GNUC_UNUSED marker for objectPath,
even though it's passed to virtDBusDomainGetVirDomain later.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
Also passes the build with clang 5.0.1, once that lock issue is fixed:
connect.c:59:29: error: unused variable 'lock' [-Werror,-Wunused-variable]
    g_autoptr(GMutexLocker) lock = g_mutex_locker_new(&connect->lock);

 src/domain.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/domain.c b/src/domain.c
index 3c09351..879366f 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -278,7 +278,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecordListF
 static void
 virtDBusDomainGetStats(GVariant *inArgs,
                        GUnixFDList *inFDs G_GNUC_UNUSED,
-                       const gchar *objectPath G_GNUC_UNUSED,
+                       const gchar *objectPath,
                        gpointer userData,
                        GVariant **outArgs,
                        GUnixFDList **outFDs G_GNUC_UNUSED,
@@ -313,7 +313,7 @@ virtDBusDomainGetStats(GVariant *inArgs,
 static void
 virtDBusDomainShutdown(GVariant *inArgs G_GNUC_UNUSED,
                        GUnixFDList *inFDs G_GNUC_UNUSED,
-                       const gchar *objectPath G_GNUC_UNUSED,
+                       const gchar *objectPath,
                        gpointer userData,
                        GVariant **outArgs G_GNUC_UNUSED,
                        GUnixFDList **outFDs G_GNUC_UNUSED,
@@ -336,7 +336,7 @@ virtDBusDomainShutdown(GVariant *inArgs G_GNUC_UNUSED,
 static void
 virtDBusDomainDestroy(GVariant *inArgs G_GNUC_UNUSED,
                       GUnixFDList *inFDs G_GNUC_UNUSED,
-                      const gchar *objectPath G_GNUC_UNUSED,
+                      const gchar *objectPath,
                       gpointer userData,
                       GVariant **outArgs G_GNUC_UNUSED,
                       GUnixFDList **outFDs G_GNUC_UNUSED,
@@ -383,7 +383,7 @@ virtDBusDomainReboot(GVariant *inArgs,
 static void
 virtDBusDomainReset(GVariant *inArgs,
                     GUnixFDList *inFDs G_GNUC_UNUSED,
-                    const gchar *objectPath G_GNUC_UNUSED,
+                    const gchar *objectPath,
                     gpointer userData,
                     GVariant **outArgs G_GNUC_UNUSED,
                     GUnixFDList **outFDs G_GNUC_UNUSED,
@@ -407,7 +407,7 @@ virtDBusDomainReset(GVariant *inArgs,
 static void
 virtDBusDomainCreate(GVariant *inArgs G_GNUC_UNUSED,
                      GUnixFDList *inFDs G_GNUC_UNUSED,
-                     const gchar *objectPath G_GNUC_UNUSED,
+                     const gchar *objectPath,
                      gpointer userData,
                      GVariant **outArgs G_GNUC_UNUSED,
                      GUnixFDList **outFDs G_GNUC_UNUSED,
@@ -430,7 +430,7 @@ virtDBusDomainCreate(GVariant *inArgs G_GNUC_UNUSED,
 static void
 virtDBusDomainUndefine(GVariant *inArgs G_GNUC_UNUSED,
                        GUnixFDList *inFDs G_GNUC_UNUSED,
-                       const gchar *objectPath G_GNUC_UNUSED,
+                       const gchar *objectPath,
                        gpointer userData,
                        GVariant **outArgs G_GNUC_UNUSED,
                        GUnixFDList **outFDs G_GNUC_UNUSED,
-- 
2.16.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [dbus PATCH] domain: remove G_GNUC_UNUSED for used attributes
Posted by Pavel Hrdina 6 years ago
On Tue, Mar 27, 2018 at 06:30:19PM +0200, Ján Tomko wrote:
> A few functions use the G_GNUC_UNUSED marker for objectPath,
> even though it's passed to virtDBusDomainGetVirDomain later.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
> Also passes the build with clang 5.0.1, once that lock issue is fixed:
> connect.c:59:29: error: unused variable 'lock' [-Werror,-Wunused-variable]
>     g_autoptr(GMutexLocker) lock = g_mutex_locker_new(&connect->lock);
> 
>  src/domain.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Thanks, I've pushed it together with the clang patch.  I didn't realize
that you would be able to push it as well.

Pavel
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list