diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2018-09-26 13:08:44 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2018-09-26 13:08:44 +0000 |
commit | 193278821fbbef992ae083e406dedcadfa19aaba (patch) | |
tree | 698c6d0b81aa9a306da5c8b3c0760d9ff7dc3686 /clang/tools/scan-build | |
parent | a43fd9522d2bfe80c3ecaf525f281c7f6e8868b5 (diff) | |
download | bcm5719-llvm-193278821fbbef992ae083e406dedcadfa19aaba.tar.gz bcm5719-llvm-193278821fbbef992ae083e406dedcadfa19aaba.zip |
[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: 343105
Diffstat (limited to 'clang/tools/scan-build')
-rwxr-xr-x | clang/tools/scan-build/bin/scan-build | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/tools/scan-build/bin/scan-build b/clang/tools/scan-build/bin/scan-build index 5500421c8c6..25aeb2bf646 100755 --- a/clang/tools/scan-build/bin/scan-build +++ b/clang/tools/scan-build/bin/scan-build @@ -1207,7 +1207,7 @@ OPTIONS: By default, the exit status of scan-build is the same as the executed build command. Specifying this option causes the exit status of scan-build to be 1 - if it found potential bugs and 0 otherwise. + if it found potential bugs and the exit status of the build itself otherwise. --exclude <path> @@ -1908,7 +1908,7 @@ if (defined $Options{OutputFormat}) { if ($Options{ExitStatusFoundBugs}) { exit 1 if ($NumBugs > 0); - exit 0; + exit $ExitStatus; } } } |