From c834c47dfc8006fbdf95a22ea4241b53d7235915 Mon Sep 17 00:00:00 2001 From: jasjuang Date: Fri, 11 Jan 2019 09:39:47 -0800 Subject: cpplint: only print diagnostics to console if there are errors Fixes: #18781 --- Source/cmcmd.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 930ced9..7287594 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -270,9 +270,12 @@ static int HandleCppLint(const std::string& runCmd, << "\n"; return 1; } - std::cerr << "Warning: cpplint diagnostics:\n"; - // Output the output from cpplint to stderr - std::cerr << stdOut; + if (!stdOut.empty()) { + std::cerr << "Warning: cpplint diagnostics:\n"; + // Output the output from cpplint to stderr + std::cerr << stdOut; + } + // always return 0 so the build can continue as cpplint returns non-zero // for any warning return 0; -- cgit v0.12