Skip to content

Commit 3e4d4dd

Browse files
committed
Merging r343105:
------------------------------------------------------------------------ r343105 | lebedevri | 2018-09-26 06:08:44 -0700 (Wed, 26 Sep 2018) | 17 lines [analyzer] scan-build: if --status-bugs is passed, don't forget about the exit status of the actual build Summary: This has been bothering me for a while, but only now i have actually looked into this. I'm using one CI job for static analysis - clang static analyzers as compilers + clang-tidy via cmake. And i'd like for the build to fail if at least one of those finds issues. If clang-tidy finds issues, it will fail the build since the warnings-as-errors is set. If static analyzer finds anything, since --status-bugs is set, it will fail the build. But if clang-tidy find anything, but static analyzer does not, the build succeeds :/ Reviewers: sylvestre.ledru, alexfh, jroelofs, ygribov, george.karpenkov, krememek Reviewed By: jroelofs Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52530 ------------------------------------------------------------------------ llvm-svn: 347829
1 parent 1ee9092 commit 3e4d4dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/tools/scan-build/bin/scan-build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ OPTIONS:
11921192
11931193
By default, the exit status of scan-build is the same as the executed build
11941194
command. Specifying this option causes the exit status of scan-build to be 1
1195-
if it found potential bugs and 0 otherwise.
1195+
if it found potential bugs and the exit status of the build itself otherwise.
11961196
11971197
--use-cc [compiler path]
11981198
--use-cc=[compiler path]
@@ -1878,7 +1878,7 @@ if (defined $Options{OutputFormat}) {
18781878

18791879
if ($Options{ExitStatusFoundBugs}) {
18801880
exit 1 if ($NumBugs > 0);
1881-
exit 0;
1881+
exit $ExitStatus;
18821882
}
18831883
}
18841884
}

0 commit comments

Comments
 (0)