C

Unused parameter warning

When using a [[wikipedia:API]] that uses callback functions there is sometimes not necessary to use at all parameters that the callback function prototype declares.

A example a API defines a callback function handleEvent as follows.
int handleFooEvent(int type, EVENT_T* event_p);

In your application you implement this function to see when a Foo Event occurs.

int handleFooEvent(int type, EVENT_T* event_p)
{
printf("Foo Event of type %d occured", type);
}

Tags: