So i have some code like this:
void foo (int, int); void bar ( ) { //Do Stuff #if (IMPORTANT == 1) foo (1, 2); #endif }
In C++17 you can declare your function with [[maybe_unused]]:
[[maybe_unused]]
[[maybe_unused]] void foo (int, int);
This will suppress the warning and is the correct, idiomatic way to express a possibly unused function in C++17.