문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top