So i have some code like this:
void foo (int, int);
void bar ( )
{
//Do Stuff
#if (IMPORTANT == 1)
foo (1, 2);
#endif
}
One solution is via function attributes.
void foo (int, int) __attribute__ ((unused));
This will tell gcc not to issue an unused function warning for the function foo. If you're worried about portability, you can define a macro UNUSED_FUNCTION_ATTRIBUTE that expands to __attribute__ ((unused)) with compilers that support attributes, but expands to nothing otherwise.