lkml.org 
[lkml]   [2003]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: [PATCH] eliminate warnings in generated module files
    Date
    In message <20030218184317.A20436@twiddle.net> you write:
    > +#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || __GNUC__ > 3
    > +#define __attribute_used__ __attribute__((__used__))
    > +#else
    > +#define __attribute_used__ __attribute__((__unused__))
    > +#endif
    > +

    After some thought, I prefer __optional. The unused attribute has
    muddied the waters too badly for "used" or "unused" to be clear.

    We could debate this for days. Linus, apply or don't.
    Rusty.
    --
    Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

    Name: __optional attribute
    Author: Rusty Russell
    Status: Trivial

    D: Renames __attribute_used to __optional.

    diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .21098-linux-2.5.63/include/linux/compiler.h .21098-linux-2.5.63.updated/include/linux/compiler.h
    --- .21098-linux-2.5.63/include/linux/compiler.h 2003-02-25 10:11:08.000000000 +1100
    +++ .21098-linux-2.5.63.updated/include/linux/compiler.h 2003-02-25 15:28:39.000000000 +1100
    @@ -37,9 +37,9 @@
    * would be warned about except with attribute((unused)).
    */
    #if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || __GNUC__ > 3
    -#define __attribute_used__ __attribute__((__used__))
    +#define __optional __attribute__((__used__))
    #else
    -#define __attribute_used__ __attribute__((__unused__))
    +#define __optional __attribute__((__unused__))
    #endif

    /* This macro obfuscates arithmetic on a variable address so that gcc
    diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .21098-linux-2.5.63/scripts/modpost.c .21098-linux-2.5.63.updated/scripts/modpost.c
    --- .21098-linux-2.5.63/scripts/modpost.c 2003-02-25 10:11:14.000000000 +1100
    +++ .21098-linux-2.5.63.updated/scripts/modpost.c 2003-02-25 15:30:37.000000000 +1100
    @@ -450,7 +450,7 @@ add_depends(struct buffer *b, struct mod

    buf_printf(b, "\n");
    buf_printf(b, "static const char __module_depends[]\n");
    - buf_printf(b, "__attribute_used__\n");
    + buf_printf(b, "__optional\n");
    buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
    buf_printf(b, "\"depends=");
    for (s = mod->unres; s; s = s->next) {
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 13:33    [W:2.457 / U:0.172 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site