Re: [patch 01/10] compiler: define __attribute_unused__

David Rientjes
2007-05-02T07:22:49Z

On Wed, 2 May 2007, Rusty Russell wrote:

> That sounds exactly right to me! If the author says it's optional, it
> might be discarded. If they say it's needed, it won't be. At least,
> when I'm coding and gcc warns me something is unused, this is the
> decision I have to make ("is this really needed or not?").
>

Hi Rusty,

There are many instances in the tree of functions that have no callers
whatsoever because they've been commented out temporarily, disabled
through configuration, etc. These are marked __attribute__ ((unused))
right now so that the compiler doesn't emit a warning (and with gcc >=3.4
it doesn't even emit code for them). What's __optional about these
functions if they have no callers? They're unused. So we cover all our
bases with __maybe_unused.