The most obvious way to archieve such behaviour is to use #error directive. However since it's not possible to construct "conditional #error directive" I guess next move is _Pragma operator introduced in C99. Here is the solution that produces a message during compilation:
#include <stdio.h>
#define DEBUG 1
#ifdef DEBUG
#define Func1(arg) _Pragma("message \"Function not supported.\"")
#endif
void (Func1)(int arg)
{
}
int main(void)
{
Func1(1);
Func1(2);
Func1(3);
return 0;
}
Compilation (with gcc):
...
check.c:15: note: #pragma message: Function not supported.
check.c:16: note: #pragma message: Function not supported.
check.c:17: note: #pragma message: Function not supported.
I know It's not direct solution (such message is not even treated as warning, so -Werror doesn't change anything), however you can use e.g. grep tool or any other method to scan compiler's output.
Since GCC 4.8 there is also #pragma GCC error "message", which is direct (but non-portable) solution. Check this answer for more information. For example:
#ifdef DEBUG
#define Func1(arg) _Pragma("GCC error \"Function not supported.\"")
#endif