Question

I've seen this definition GCC_UNUSED used in quite a few places (curses, CDK). I tried searching for it but I couldn't find anything. Does anyone know what it means?

Était-ce utile?

La solution

Usually it's a macro definition, something like:

#ifdef __GNUC__
#  define GCC_UNUSED __attribute__((unused))
#else
#  define GCC_UNUSED
#endif

The unused attribute, attached to a variable, means that the variable is meant to be possibly unused. GCC will not produce a warning for this variable.

Autres conseils

It's not a GCC macro, it's something the code you're looking at is doing, which is related to GCC.

Most probably a way to avoid "parameter unused"-warnings.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top