Re: [PATCH 1/2] compiler: Introduce __always_unused

From: Li Zefan
Date: Sun Nov 01 2009 - 21:05:55 EST

Arjan van de Ven wrote:
> On Mon, 02 Nov 2009 08:50:52 +0800
> Li Zefan <lizf@xxxxxxxxxxxxxx> wrote:
> Hi,
>> I wrote some code which is used as compile-time checker, and the
>> code should be elided after compile.
>> +#define __always_unused
>> __attribute__((unused))
> I have a suggestion.
> In addition to marking it attribute unused, would it be useful to also
> put a section attribute as part of this, to a section that we can then
> drop from the binary by way of the linker script ?

__unused is used to suppress define-but-unused warning. If the
annotated symbol is really unused, it will be optimized out,
so I think we don't need to add a section for this.

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