diff --git a/infer/man/man1/infer-analyze.txt b/infer/man/man1/infer-analyze.txt index 91292a465..da783a88c 100644 --- a/infer/man/man1/infer-analyze.txt +++ b/infer/man/man1/infer-analyze.txt @@ -46,15 +46,6 @@ OPTIONS reactive analysis should start. Source files should be specified relative to project root or be absolute - --check-nullable - Activates: checks that values annotated with nullable are always - checked for null before dereference (Conversely: - --no-check-nullable) - - --check-nullable-only - Activates: Enable --check-nullable and disable all other checkers - (Conversely: --no-check-nullable-only) - --class-loads Activates: Java class loading analysis (Conversely: --no-class-loads) @@ -194,6 +185,14 @@ OPTIONS Activates: Enable --loop-hoisting and disable all other checkers (Conversely: --no-loop-hoisting-only) + --nullsafe + Activates: [EXPERIMENTAL] Nullable type checker (incomplete: use + --eradicate for now) (Conversely: --no-nullsafe) + + --nullsafe-only + Activates: Enable --nullsafe and disable all other checkers + (Conversely: --no-nullsafe-only) + --no-ownership Deactivates: the detection of C++ lifetime bugs (Conversely: --ownership) diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index e9783fb54..e3e8e4b12 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -134,15 +134,6 @@ OPTIONS reactive analysis should start. Source files should be specified relative to project root or be absolute See also infer-analyze(1) and infer-diff(1). - --check-nullable - Activates: checks that values annotated with nullable are always - checked for null before dereference (Conversely: - --no-check-nullable) See also infer-analyze(1). - - --check-nullable-only - Activates: Enable --check-nullable and disable all other checkers - (Conversely: --no-check-nullable-only) See also infer-analyze(1). - --clang-biniou-file file Specify a file containing the AST of the program, in biniou format See also infer-capture(1). @@ -571,6 +562,14 @@ OPTIONS (default: cf) See also infer-analyze(1). + --nullsafe + Activates: [EXPERIMENTAL] Nullable type checker (incomplete: use + --eradicate for now) (Conversely: --no-nullsafe) See also infer-analyze(1). + + --nullsafe-only + Activates: Enable --nullsafe and disable all other checkers + (Conversely: --no-nullsafe-only) See also infer-analyze(1). + --only-show Activates: Show the list of reports and exit (Conversely: --no-only-show) See also infer-explore(1). diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index b6318c34e..ab2a01794 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -134,15 +134,6 @@ OPTIONS reactive analysis should start. Source files should be specified relative to project root or be absolute See also infer-analyze(1) and infer-diff(1). - --check-nullable - Activates: checks that values annotated with nullable are always - checked for null before dereference (Conversely: - --no-check-nullable) See also infer-analyze(1). - - --check-nullable-only - Activates: Enable --check-nullable and disable all other checkers - (Conversely: --no-check-nullable-only) See also infer-analyze(1). - --clang-biniou-file file Specify a file containing the AST of the program, in biniou format See also infer-capture(1). @@ -571,6 +562,14 @@ OPTIONS (default: cf) See also infer-analyze(1). + --nullsafe + Activates: [EXPERIMENTAL] Nullable type checker (incomplete: use + --eradicate for now) (Conversely: --no-nullsafe) See also infer-analyze(1). + + --nullsafe-only + Activates: Enable --nullsafe and disable all other checkers + (Conversely: --no-nullsafe-only) See also infer-analyze(1). + --only-show Activates: Show the list of reports and exit (Conversely: --no-only-show) See also infer-explore(1). diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 85d3abebf..2a49470cd 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -588,7 +588,6 @@ and analyzer = and ( annotation_reachability , biabduction , bufferoverrun - , check_nullable , class_loads , cost , crashcontext @@ -599,6 +598,7 @@ and ( annotation_reachability , litho , liveness , loop_hoisting + , nullsafe , ownership , printf_args , pulse @@ -630,9 +630,6 @@ and ( annotation_reachability mk_checker ~long:"biabduction" ~default:true "the separation logic based bi-abduction analysis using the checkers framework" and bufferoverrun = mk_checker ~long:"bufferoverrun" "the buffer overrun analysis" - and check_nullable = - mk_checker ~long:"check-nullable" - "checks that values annotated with nullable are always checked for null before dereference" and class_loads = mk_checker ~long:"class-loads" ~default:false "Java class loading analysis" and cost = mk_checker ~long:"cost" ~default:false "checker for performance cost analysis" and crashcontext = @@ -652,6 +649,9 @@ and ( annotation_reachability and liveness = mk_checker ~long:"liveness" ~default:true "the detection of dead stores and unused variables" and loop_hoisting = mk_checker ~long:"loop-hoisting" ~default:false "checker for loop-hoisting" + and nullsafe = + mk_checker ~long:"nullsafe" ~deprecated:["-check-nullable"] + "[EXPERIMENTAL] Nullable type checker (incomplete: use --eradicate for now)" and ownership = mk_checker ~long:"ownership" ~default:true "the detection of C++ lifetime bugs" and printf_args = mk_checker ~long:"printf-args" ~default:true @@ -715,7 +715,6 @@ and ( annotation_reachability ( annotation_reachability , biabduction , bufferoverrun - , check_nullable , class_loads , cost , crashcontext @@ -726,6 +725,7 @@ and ( annotation_reachability , litho , liveness , loop_hoisting + , nullsafe , ownership , printf_args , pulse @@ -2531,7 +2531,7 @@ and capture_blacklist = !capture_blacklist and changed_files_index = !changed_files_index -and check_nullable = !check_nullable +and nullsafe = !nullsafe and check_version = !check_version diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 1973cae14..79827f329 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -268,7 +268,7 @@ val captured_dir : string val changed_files_index : string option -val check_nullable : bool +val nullsafe : bool val check_version : string option diff --git a/infer/src/checkers/registerCheckers.ml b/infer/src/checkers/registerCheckers.ml index 311e189f2..89eb50767 100644 --- a/infer/src/checkers/registerCheckers.ml +++ b/infer/src/checkers/registerCheckers.ml @@ -34,7 +34,7 @@ let all_checkers = ; active= Config.annotation_reachability ; callbacks= [(Procedure AnnotationReachability.checker, Language.Java)] } ; { name= "nullable checks" - ; active= Config.check_nullable + ; active= Config.nullsafe ; callbacks= [ (Procedure NullabilityCheck.checker, Language.Clang) ; (Procedure NullabilityCheck.checker, Language.Java) ] } diff --git a/infer/src/deadcode/Makefile b/infer/src/deadcode/Makefile index d0b7eb8b4..9c8fa3fd3 100644 --- a/infer/src/deadcode/Makefile +++ b/infer/src/deadcode/Makefile @@ -45,8 +45,8 @@ depend: cd .. && \ ocamldep -native \ -I IR -I absint -I atd -I backend -I base -I biabduction -I bufferoverrun -I checkers \ - -I clang -I concurrency -I nullsafe -I facebook -I integration -I istd \ - -I java -I labs -I quandary -I unit -I unit/clang -I deadcode \ + -I clang -I concurrency -I facebook -I integration -I istd -I java \ + -I labs -I nullsafe -I quandary -I unit -I unit/clang -I deadcode \ $(ml_src_files) > deadcode/.depend # circular dependency... not sure how to fix properly diff --git a/infer/src/dune.in b/infer/src/dune.in index 7a1e76136..d51c077e2 100644 --- a/infer/src/dune.in +++ b/infer/src/dune.in @@ -19,9 +19,9 @@ let source_dirs = ; "bufferoverrun" ; "checkers" ; "concurrency" - ; "nullsafe" ; "integration" ; "labs" + ; "nullsafe" ; "quandary" ; "unit" ] ) diff --git a/infer/tests/codetoanalyze/cpp/conflicts/Makefile b/infer/tests/codetoanalyze/cpp/conflicts/Makefile index 727c1e104..89bcc2b3b 100644 --- a/infer/tests/codetoanalyze/cpp/conflicts/Makefile +++ b/infer/tests/codetoanalyze/cpp/conflicts/Makefile @@ -7,7 +7,7 @@ TESTS_DIR = ../../.. CLANG_OPTIONS = -c -x c++ -std=c++14 -INFER_OPTIONS = --no-default-checkers --biabduction --check-nullable --project-root $(TESTS_DIR) +INFER_OPTIONS = --no-default-checkers --biabduction --nullsafe --project-root $(TESTS_DIR) INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.cpp) diff --git a/infer/tests/codetoanalyze/cpp/nullable/Makefile b/infer/tests/codetoanalyze/cpp/nullable/Makefile index 6423ffded..22fb96c92 100644 --- a/infer/tests/codetoanalyze/cpp/nullable/Makefile +++ b/infer/tests/codetoanalyze/cpp/nullable/Makefile @@ -7,7 +7,7 @@ TESTS_DIR = ../../.. # see explanations in cpp/errors/Makefile for the custom isystem CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c -INFER_OPTIONS = --biabduction --suggest-nullable --check-nullable --debug-exceptions --project-root $(TESTS_DIR) +INFER_OPTIONS = --biabduction --suggest-nullable --nullsafe --debug-exceptions --project-root $(TESTS_DIR) INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.cpp) diff --git a/infer/tests/codetoanalyze/java/checkers/Makefile b/infer/tests/codetoanalyze/java/checkers/Makefile index 83eb493d4..9d556a0f3 100644 --- a/infer/tests/codetoanalyze/java/checkers/Makefile +++ b/infer/tests/codetoanalyze/java/checkers/Makefile @@ -8,7 +8,7 @@ TESTS_DIR = ../../.. INFER_OPTIONS = \ --debug-exceptions --no-default-checkers \ --annotation-reachability --fragment-retains-view --immutable-cast --printf-args --quandary \ - --suggest-nullable --check-nullable --racerd \ + --suggest-nullable --nullsafe --racerd \ INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java) $(wildcard $(TESTS_DIR)/external/library/*.java) diff --git a/infer/tests/codetoanalyze/objc/nullable/Makefile b/infer/tests/codetoanalyze/objc/nullable/Makefile index 247458cec..8a7f287c0 100644 --- a/infer/tests/codetoanalyze/objc/nullable/Makefile +++ b/infer/tests/codetoanalyze/objc/nullable/Makefile @@ -6,7 +6,7 @@ TESTS_DIR = ../../.. CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS) -INFER_OPTIONS = --debug-exceptions --no-default-checkers --suggest-nullable --check-nullable --project-root $(TESTS_DIR) +INFER_OPTIONS = --debug-exceptions --no-default-checkers --suggest-nullable --nullsafe --project-root $(TESTS_DIR) INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.m) diff --git a/infer/tests/codetoanalyze/objcpp/nullable/Makefile b/infer/tests/codetoanalyze/objcpp/nullable/Makefile index 7f7dd5ac2..fa23bf825 100644 --- a/infer/tests/codetoanalyze/objcpp/nullable/Makefile +++ b/infer/tests/codetoanalyze/objcpp/nullable/Makefile @@ -6,7 +6,7 @@ TESTS_DIR = ../../.. CLANG_OPTIONS = -c $(OBJCPP_CLANG_OPTIONS) -INFER_OPTIONS = --debug-exceptions --no-default-checkers --suggest-nullable --check-nullable --project-root $(TESTS_DIR) +INFER_OPTIONS = --debug-exceptions --no-default-checkers --suggest-nullable --nullsafe --project-root $(TESTS_DIR) INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.mm)