]> granicus.if.org Git - clang/blobdiff - lib/Driver/Tools.cpp
[Static Analyzer] Turn on some nullability checks by default.
[clang] / lib / Driver / Tools.cpp
index 1b79ed730fa21882423312280a4a20673f13b76a..7a5368a5faf3f4023ae118ec5c6d9baef57932dc 100644 (file)
@@ -3322,6 +3322,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
       CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mktemp");
       CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mkstemp");
       CmdArgs.push_back("-analyzer-checker=security.insecureAPI.vfork");
+
+      // Default nullability checks.
+      CmdArgs.push_back("-analyzer-checker=nullability.NullPassedToNonnull");
+      CmdArgs.push_back(
+          "-analyzer-checker=nullability.NullReturnedFromNonnull");
     }
 
     // Set the output format. The default is plist, for (lame) historical