[PATCH] Avoid variable named 'stat'

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

 



Using a variable named 'stat' clashes with the system function
'stat()' causing compiler warnings on some platforms

cc1: warnings being treated as errors
../../src/qemu/qemu_monitor_text.c: In function 'parseMemoryStat':
../../src/qemu/qemu_monitor_text.c:604: error: declaration of 'stat' shadows a global declaration [-Wshadow]
/usr/include/sys/stat.h:455: error: shadowed declaration is here [-Wshadow]

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---

Pushed as a build fix.

 src/qemu/qemu_monitor_text.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index a2a5885..bc83218 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -601,7 +601,7 @@ int qemuMonitorTextGetVirtType(qemuMonitorPtr mon,
 
 
 static int parseMemoryStat(char **text, unsigned int tag,
-                           const char *search, virDomainMemoryStatPtr stat)
+                           const char *search, virDomainMemoryStatPtr mstat)
 {
     char *dummy;
     unsigned long long value;
@@ -625,8 +625,8 @@ static int parseMemoryStat(char **text, unsigned int tag,
             case VIR_DOMAIN_MEMORY_STAT_AVAILABLE:
                 value >>= 10;
         }
-        stat->tag = tag;
-        stat->val = value;
+        mstat->tag = tag;
+        mstat->val = value;
         return 1;
     }
     return 0;
-- 
2.9.3

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



[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