From a6d7bbb38b0ac078b04d3edd2a1b45096b87da7a Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Wed, 17 Feb 2016 03:07:52 -0800 Subject: [PATCH] Warn of unescaped end-of-line in a string constant Summary: public Reviewed By: jvillard Differential Revision: D2938332 fb-gh-sync-id: a8cd30f shipit-source-id: a8cd30f --- infer/src/Makefile.in | 1 + infer/src/backend/dotty.ml | 4 ++-- infer/src/backend/inferanalyze.ml | 16 ++++++++-------- infer/src/backend/inferprint.ml | 12 ++++++------ infer/src/clang/cMain.ml | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index e70e48603..78c8daca9 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -91,6 +91,7 @@ OCAMLBUILD_OPTIONS = \ -cflags -w,@19 \ -cflags -w,@20 \ -cflags -w,@26 \ + -cflags -w,@29 \ -cflags -w,@33 \ -cflags -w,@34 \ -cflags -w,@35 \ diff --git a/infer/src/backend/dotty.ml b/infer/src/backend/dotty.ml index 8fb63813a..fd44913bb 100644 --- a/infer/src/backend/dotty.ml +++ b/infer/src/backend/dotty.ml @@ -730,12 +730,12 @@ let rec print_struct f pe e te l coo c = F.fprintf f "subgraph structs_%iL%i {\n" n lambda ; if !print_full_prop then F.fprintf f - " node [shape=record]; \n struct%iL%i + " node [shape=record]; \n struct%iL%i \ [label=\"{<%s%iL%i> STRUCT: %a } | %a\" ] fontcolor=%s\n" n lambda e_no_special_char n lambda (Sil.pp_exp pe) e (struct_to_dotty_str pe coo) l c else F.fprintf f - " node [shape=record]; \n struct%iL%i + " node [shape=record]; \n struct%iL%i \ [label=\"{<%s%iL%i> OBJECT: %s } | %a\" ] fontcolor=%s\n" n lambda e_no_special_char n lambda print_type (struct_to_dotty_str pe coo) l c; F.fprintf f "}\n" diff --git a/infer/src/backend/inferanalyze.ml b/infer/src/backend/inferanalyze.ml index 5969eed79..b312846b6 100644 --- a/infer/src/backend/inferanalyze.ml +++ b/infer/src/backend/inferanalyze.ml @@ -158,13 +158,13 @@ let arg_desc = "-iterations", Arg.Set_int iterations_cmdline, Some "n", - "set the max number of operations for each function, + "set the max number of operations for each function, \ expressed as a multiple of symbolic operations (default n=1)" ; "-nonstop", Arg.Set Config.nonstop, None, - "activate the nonstop mode: the analysis continues after finding errors. + "activate the nonstop mode: the analysis continues after finding errors. \ With this option the analysis can become less precise." ; "-out_file", @@ -180,7 +180,7 @@ let arg_desc = "-source_path", Arg.String source_path, Some "path", - "specify the absolute path to the root of the source files. + "specify the absolute path to the root of the source files. \ Used to interpret relative paths when using option -exclude." ; (* TODO: merge with the -project_root option *) @@ -212,7 +212,7 @@ let arg_desc = "-ml_buckets", Arg.Set_string ml_buckets_arg, Some "ml_buckets", - "memory leak buckets to be checked, separated by commas. + "memory leak buckets to be checked, separated by commas. \ The possible buckets are cf (Core Foundation), arc, narc (No arc), cpp, unknown_origin" ; ] in @@ -229,7 +229,7 @@ let arg_desc = "-angelic_execution", Arg.Set Config.angelic_execution, None, - "activate angelic execution: + "activate angelic execution: \ The analysis ignores errors caused by unknown procedure calls." ; "-checkers", @@ -342,9 +342,9 @@ let arg_desc = base_arg @ reserved_arg let usage = - (version_string ()) ^ " -Usage: InferAnalyze [options] - Analyze the files captured in the project results directory, + (version_string ()) ^ "\ + Usage: InferAnalyze [options]\n\ + Analyze the files captured in the project results directory, \ which can be specified with the -results_dir option." let print_usage_exit () = diff --git a/infer/src/backend/inferprint.ml b/infer/src/backend/inferprint.ml index 01b5891a8..90a2f0d22 100644 --- a/infer/src/backend/inferprint.ml +++ b/infer/src/backend/inferprint.ml @@ -167,7 +167,7 @@ let arg_desc = "-test_filtering", Arg.Set test_filtering, None, - "list all the files Infer can report on (should be call at the root of the procject, + "list all the files Infer can report on (should be call at the root of the procject, \ where .inferconfig lives)." ; "-analyzer", @@ -235,11 +235,11 @@ let arg_desc = base_arg @ reserved_arg let usage = - "Usage: InferPrint [options] name1.specs ... namen.specs - Read, convert, and print .specs files. - To process all the .specs in the current directory, pass . as only parameter - To process all the .specs in the results directory, use option -results_dir - Each spec is printed to standard output unless option -q is used." + "Usage: InferPrint [options] name1.specs ... namen.specs\n\ + Read, convert, and print .specs files. \ + To process all the .specs in the current directory, pass . as only parameter \ + To process all the .specs in the results directory, use option -results_dir \ + Each spec is printed to standard output unless option -q is used." let print_usage_exit err_s = L.err "Load Error: %s@.@." err_s; diff --git a/infer/src/clang/cMain.ml b/infer/src/clang/cMain.ml index efc3d6dae..cefa73d91 100644 --- a/infer/src/clang/cMain.ml +++ b/infer/src/clang/cMain.ml @@ -53,7 +53,7 @@ let arg_desc = "-testing_mode", Arg.Unit (fun _ -> CFrontend_config.testing_mode := true), None, - "Mode for testing, where no libraries are translated, + "Mode for testing, where no libraries are translated, \ including enums defined in the libraries" ; "-debug",