From: Ian Campbell Subject: Re: [PATCH 13/20] libxl: Allow AO_GC and EGC_GC even if not used Date: Mon, 16 Apr 2012 15:43:58 +0100 Message-ID: <1334587438.14560.200.camel@zakaz.uk.xensource.com> References: <1334342414-10289-1-git-send-email-ian.jackson@eu.citrix.com> <1334342414-10289-14-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1334342414-10289-14-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Fri, 2012-04-13 at 19:40 +0100, Ian Jackson wrote: > 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 Needed this for one of my patches (just sent, with a reference to this patch). So: Acked-by: Ian Campbell > --- > tools/libxl/libxl_internal.h | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 4cfb8d5..74dc2c5 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -1280,7 +1280,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: */ > > @@ -1383,7 +1383,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); \