Mail Archives: djgpp/1996/08/17/05:16:49
: I want to get rid off the 'unused variable XXX' warning messages,
: especially in the following case:
: void Test(int a)
: {
: };
: int a is unused, of course, therefor I get a warning message. To overcome
: this warning message I tried to use the __attribute__((unused)) in the
: following way:
: #define UNUSED __attribute__((unused))
: void Test(int a UNUSED)
: {
: };
Try using the UNUSED in the prototype but NOT the definition:
void Test(int a UNUSED);
void Test(int a)
{
};
This works for other attributes, which have the nice property of crashing
gcc if you put them in the defintion.
Sengan
- Raw text -