]> xenbits.xensource.com Git - libvirt.git/commitdiff
esx: Fix gcc 4.6 warning about initialized but unused variables
authorMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 14 Apr 2011 17:18:27 +0000 (19:18 +0200)
committerEric Blake <eblake@redhat.com>
Fri, 15 Apr 2011 18:31:38 +0000 (12:31 -0600)
This warnings come from partly generated code. Therefore, the best
solution is to mark them as potentially being unused using the
ATTRIBUTE_UNUSED macro. This is suggested by the gcc documentation.

Reported by Christophe Fergeau

src/esx/esx_vi.c
src/esx/esx_vi_types.c

index 9d5768dd46bf615dc550f4c1e1ac80a320c58250..951f537051ab6ace2f64301c287f8eebf2791cb8 100644 (file)
@@ -60,7 +60,7 @@
     void                                                                      \
     esxVI_##_type##_Free(esxVI_##_type **ptrptr)                              \
     {                                                                         \
-        esxVI_##_type *item = NULL;                                           \
+        esxVI_##_type *item ATTRIBUTE_UNUSED;                                 \
                                                                               \
         if (ptrptr == NULL || *ptrptr == NULL) {                              \
             return;                                                           \
index 29a3c397fa22c47907d31675dd7e3d4fb495856e..d264583d9cae6ea270c826d7d9f6cdb215e08bcd 100644 (file)
@@ -58,7 +58,7 @@
     void                                                                      \
     esxVI_##_type##_Free(esxVI_##_type **ptrptr)                              \
     {                                                                         \
-        esxVI_##_type *item = NULL;                                           \
+        esxVI_##_type *item ATTRIBUTE_UNUSED;                                 \
                                                                               \
         if (ptrptr == NULL || *ptrptr == NULL) {                              \
             return;                                                           \
     esxVI_##_type##_Cast##_dest_extra##FromAnyType(esxVI_AnyType *anyType,    \
                                                    _dest_type **ptrptr)       \
     {                                                                         \
-        _dest_type *item;                                                     \
+        _dest_type *item ATTRIBUTE_UNUSED;                                    \
                                                                               \
         if (anyType == NULL || ptrptr == NULL || *ptrptr != NULL) {           \
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",                        \