[lkml]   [2004]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: __attribute__((unused))
On Thu, 2004-10-14 at 22:02 +0100, Russell King wrote:
> Hi,
> I notice that module.h contains stuff like:
> #define MODULE_GENERIC_TABLE(gtype,name) \
> extern const struct gtype##_id __mod_##gtype##_table \
> __attribute__ ((unused, alias(__stringify(name))))
> and even:
> #define __MODULE_INFO(tag, name, info) \
> static const char __module_cat(name,__LINE__)[] \
> __attribute_used__ \
> __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
> My understanding is that we shouldn't be using __attribute__((unused))
> in either of these - can someone confirm.

Since the structure in question isn't explicitly referenced from
elsewhere, the compiler may feel free to omit it. Since we want the
compiler to emit it, not omit it, we use "unused" to say "yes, I know it
looks unused; please emit it anyway". Later compilers use "used" to say
"I use it really; please emit it anyway", meaning much the same thing.

Or something like that.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:07    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean