njames93 created this revision. njames93 added reviewers: alexfh, jroelofs, aaron.ballman. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang.
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 <https://reviews.llvm.org/D15528> Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D81953 Files: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp Index: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp =================================================================== --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -478,7 +478,7 @@ llvm::errs() << WErrorCount << " warning" << Plural << " treated as error" << Plural << "\n"; } - return WErrorCount; + return 1; } if (FoundErrors) {
Index: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp =================================================================== --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -478,7 +478,7 @@ llvm::errs() << WErrorCount << " warning" << Plural << " treated as error" << Plural << "\n"; } - return WErrorCount; + return 1; } if (FoundErrors) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits