From: Jonathan Nieder Date: Sat, 12 Jun 2010 06:42:51 GMT Subject: Re: [PATCH 1/6] Add memory pool library Message-ID: <20100612064250.GB2549@burratino> In-Reply-To: <1276175389-6185-2-git-send-email-artagnon@gmail.com> Ramkumar Ramachandra wrote: > +#define obj_pool_gen(pre, obj_t, initial_capacity) \ > +static struct { \ > + uint32_t committed; \ > + uint32_t size; \ > + uint32_t capacity; \ > + obj_t *base; \ > + FILE *file; \ > +} pre##_pool = { 0, 0, 0, NULL, NULL}; \ > +static void pre##_init(void) \ > +{ \ [...] This defines a family of functions and not all pools use them all. One workaround is to annotate them, like this: #ifdef __GNUC__ #define MAYBE_UNUSED __attribute__((__unused__)) #else #define MAYBE_UNUSED #endif #define obj_pool_gen(pre, obj_t, initial_capacity) \ ... \ static MAYBE_UNUSED void pre##_init(void) \ { \ ... Could that work here? The “unused” attribute was added in gcc 2.7. Jonathan