Search code examples
c++gccclang

max number of allowable warnings while compiling


Is it possible to 'tell' compiler that if total number of warnings (while compiling a C++ program) are more than say 10 then stop compiling further, and emit an error? Or is it possible to hack a compiler like clang to provide this functionality.


Solution

  • I haven't seen this kind of feature in gcc or clang. You can certainly try to patch it into either of them, both are open source. There is also -Werror (accepted by both compilers) which simply treats warnings as errors.