From: Ian Jackson Date: Fri, 11 May 2012 17:59:01 +0000 (+0100) Subject: libxl: Allow AO_GC and EGC_GC even if not used X-Git-Tag: 4.2.0-rc1~375 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=61f04e2d73f89f34e842f6ed9902e8d1e4cc0b5d;p=xen.git libxl: Allow AO_GC and EGC_GC even if not used 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 Acked-by: Ian Campbell Committed-by: Ian Jackson --- diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index c5ec58670b..21fe99c839 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -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); \