[Ffmpeg-devel] attribute_unused

Måns Rullgård mru
Tue Dec 20 04:54:49 CET 2005

Steve Lhomme <slhomme at divxcorp.com> writes:

> Hi,
> Can anyone explain me the use/need for 'attribute_unused' ?

It tells the compiler not to issue a warning if it thinks a symbol
with that attribute is unused.  This can be the case if it is only
used in inline assembler.  Another case is when macro templates
declare variables which are not always used.

> I can understand it has its use in structures (where it's not
> used).

Just how would you use it there?

> But in the code ? Especially code portable on various devices with
> different ways of using registers ?

It's got nothing to do with registers.  A variable is either used, or
it's not.  Sometimes you just don't want the warning about one not
being used.

M?ns Rullg?rd
mru at inprovide.com

More information about the ffmpeg-devel mailing list