If we write:
void foo() {
#warning "Danger Will Robinson!"
}
we'll get a warning when compiling foo()
. Now, What I want to do is for the compilation not to emit a warning, but for a warning to be emitted if foo()
is called.
Is that possible, using g++ and/or clang++?
Note: This question is somewhat similar to this one, about marking functions as "deprecated" (a-la C++14's [[deprecated]]
attribute). However, it's a different semantic. I do not want people to get the notion that my function is deprecated, but rather get a custom warning.