[clang-tidy] warnings-as-error no longer exits with ErrorCount
authorNathan James <n.james93@hotmail.co.uk>
Wed, 17 Jun 2020 13:35:32 +0000 (14:35 +0100)
committerNathan James <n.james93@hotmail.co.uk>
Wed, 17 Jun 2020 13:35:37 +0000 (14:35 +0100)
When using `-warnings-as-errors`, If there are any warnings promoted to errors, clang-tidy exits with the number of warnings. This really isn't needed and can cause issues when the number of warnings doesn't fit into 8 bits as POSIX terminals aren't designed to handle more than that.
This addresses https://bugs.llvm.org/show_bug.cgi?id=46305.

Bug originally added in D15528

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D81953

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp

index aca16b0..7f66834 100644 (file)
@@ -478,7 +478,7 @@ int clangTidyMain(int argc, const char **argv) {
       llvm::errs() << WErrorCount << " warning" << Plural << " treated as error"
                    << Plural << "\n";
     }
-    return WErrorCount;
+    return 1;
   }
 
   if (FoundErrors) {