I am working on a multiplatform project, and some platforms have disabled features, and in the interface for those features, a common thing I do is something like this:
bool Foo::bar() const {
// disabled
abort();
}
GCC/LLVM do not require that non-void functions return values (they just give a warning), and in this case, where I call abort()
, they are smart enough to not even give a warning (since the function will never return anyway).
Is there a way (compile flag?) to make Visual C++ 2010 behave the same way, so I don't keep breaking the Windows build? I know I could always return the value after the abort, but when working on the other platforms I usually forget about that, and the behavior of not giving an error seems more appropriate.