From 3790ca54878d0b5ae9764d96889752f1dc6ed47d Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 13 Oct 2017 09:29:46 -0700 Subject: [PATCH] [checkers] declare --resource-leak with the other checkers Summary: This generates `--resource-leak-only` automatically, and make the other checkers' `-only` option work as expected with respect to `--resource-leak` too (eg, `--resource-leak --biabduction-only` disables resource leak). Reviewed By: jeremydubreil Differential Revision: D6051134 fbshipit-source-id: 2d4a2ba --- infer/src/base/Config.ml | 6 +++--- infer/tests/codetoanalyze/java/lab/Makefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 166a126ab..511c7918b 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -604,6 +604,7 @@ and ( annotation_reachability , printf_args , quandary , repeated_calls + , resource_leak , siof , threadsafety , suggest_nullable ) = @@ -643,6 +644,7 @@ and ( annotation_reachability "the detection of mismatch between the Java printf format strings and the argument types For, example, this checker will warn about the type error in `printf(\"Hello %d\", \"world\")`" and repeated_calls = mk_checker ~long:"repeated-calls" "check for repeated calls" and quandary = mk_checker ~long:"quandary" ~default:true "the quandary taint analysis" + and resource_leak = mk_checker ~long:"resource-leak" "" and siof = mk_checker ~long:"siof" ~default:true "the Static Initialization Order Fiasco analysis (C++ only)" @@ -687,6 +689,7 @@ and ( annotation_reachability , printf_args , quandary , repeated_calls + , resource_leak , siof , threadsafety , suggest_nullable ) @@ -1489,9 +1492,6 @@ and report_previous = ~in_help:CLOpt.([(ReportDiff, manual_generic)]) "Report of the base revision to use for comparison" -and resource_leak = - CLOpt.mk_bool ~long:"resource-leak" ~default:false "the resource leak analysis (experimental)" - and rest = CLOpt.mk_rest_actions ~in_help:CLOpt.([(Capture, manual_generic); (Run, manual_generic)]) "Stop argument processing, use remaining arguments as a build command" ~usage:exe_usage diff --git a/infer/tests/codetoanalyze/java/lab/Makefile b/infer/tests/codetoanalyze/java/lab/Makefile index 5d60a4d62..50535fba2 100644 --- a/infer/tests/codetoanalyze/java/lab/Makefile +++ b/infer/tests/codetoanalyze/java/lab/Makefile @@ -8,7 +8,7 @@ TESTS_DIR = ../../.. ANALYZER = checkers -INFER_OPTIONS = --debug-exceptions --no-default-checkers --resource-leak +INFER_OPTIONS = --resource-leak-only --debug-exceptions INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java)