Reputation: 4617
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?
Upvotes: 1
Views: 237
Reputation: 18922
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.
Upvotes: 1
Reputation: 399889
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.
Upvotes: 0