]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: Allow AO_GC and EGC_GC even if not used
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 11 May 2012 17:59:01 +0000 (18:59 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 11 May 2012 17:59:01 +0000 (18:59 +0100)
Mark the gc produced by AO_GC and EGC_GC with the gcc feature
__attribute__((unused)).  This allows the use of EGC_INIT and
STATE_AO_GC by functions which do actually use the gc.

This is convenient because those functions might want to use the ao or
egc, rather than the gc; and also because it means that functions
which morally ought to be fishing any gc they use out of an egc or
state structure can be written do so regardless of whether the gc is
actually used right then.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/libxl_internal.h

index c5ec58670be9c545458a541e00dcc6ce91f6af06..21fe99c839e20021880046e3c378cd183397e61d 100644 (file)
@@ -1287,7 +1287,7 @@ libxl__device_model_version_running(libxl__gc *gc, uint32_t domid);
 /* useful for all functions which take an egc: */
 
 #define EGC_GC                                  \
-    libxl__gc *const gc = &egc->gc
+    libxl__gc *const gc __attribute__((unused)) = &egc->gc
 
 /* egc initialisation and destruction: */
 
@@ -1390,7 +1390,7 @@ _hidden void libxl__egc_cleanup(libxl__egc *egc);
     })
 
 #define AO_GC                                   \
-    libxl__gc *const gc = &ao->gc
+    libxl__gc *const gc __attribute__((unused)) = &ao->gc
 
 #define STATE_AO_GC(op_ao)                      \
     libxl__ao *const ao = (op_ao);              \