So i have some code like this:
void foo (int, int);
void bar ( )
{
//Do Stuff
#if (IMPORTANT == 1)
foo (1, 2);
#endif
}
I'm fairly sure the relevant warning option is this one:
-Wunused-function
Warn whenever a static function is declared but not defined or a non-inline static function is unused. This warning is enabled by -Wall.
So the warning should only be given for a static function, interesting. Makes sense. If a function is static it can only be used within the current file, so its definition must also be in this file.
And declaring it static inline avoids the warning, without resorting to ugly macros or compiler-specific pragmas or attributes.