"Capture the build command or compilation database specified on the command line: infer intercepts calls to the compiler to read source files, translate them into infer's intermediate representation, and store the result of the translation in the results directory."
"Intercepts compilation commands similarly to $(b,infer-capture), but simply execute these compilation commands and do not perform any translation of the source files. This can be useful to configure build systems or for debugging purposes."
]
~examples:
[`P
"$(b,cmake)(1) hardcodes the absolute paths to the compiler inside the Makefiles it generates, which defeats the later capture of compilation commands by infer. Thus, to capture a CMake project, one should configure the project from within the infer build environment, for instance:"
"Show the list of bugs on the console and explore symbolic program traces emitted by infer to explain a report. Can also generate an HTML report from a JSON report."
"Infer is a static analyzer. Given a collection of source files written in Java or in languages of the C family, and a command to build them, infer produces a list of potential issues."
"When run without a subcommand, and if a compilation command is specified via the $(b,--) option or one of the $(b,--clang-compilation-database[-escaped]) options, then $(b,infer) behaves as $(b,infer-run)(1). Otherwise, $(b,infer) behaves as $(b,infer-analyze)(1)."
"Options are read from the $(b,%s) file, then from the $(b,%s) environment variable, then from the command line. Options in $(b,%s) take precedence over options in $(b,%s), and options passed on the command line take precedence over options in $(b,%s). See the $(i,%s) and $(i,%s) sections of this manual for more information."
"Options can be specified inside an argument file $(i,file) by passing $(b,@)$(i,file) as argument. The format is one option per line, and enclosing single ' and double \" quotes are ignored."
"Options without a default value (e.g., $(b,--linter)) and options with list-like values (e.g., $(b,--Xbuck)) all have a corresponding $(b,--option-reset) flag that resets their values to nothing or the empty list, respectively. For instance, $(b,--Xbuck-reset) will cancel any previous $(b,--Xbuck) option passed to infer."
"See the manuals of individual infer commands for details about their supported options. The following is a list of all the supported options (see also $(b,--help-full) for options reserved for internal use)."
])
~environment:
[`P
(Printf.sprintf
"Extra arguments may be passed to all infer commands using the $(b,%s) environment variable (see the $(i,%s) section). $(b,%s) is expected to contain a string of %c-separated options. For instance, calling `%s=--debug^--print-logs infer` is equivalent to calling `infer --debug --print-logs`."
"If $(b,%s) is set to \"1\", then infer commands will exit with an error code in some cases when otherwise a simple warning would be emitted on stderr, for instance if a deprecated form of an option is used."
CLOpt.strict_mode_env_var)]
~files:
[`P
(Printf.sprintf
"$(b,%s) can be used to store infer options. Its format is that of a JSON record, where fields are infer long-form options, without their leading \"--\", and values depend on the type of the option:"
inferconfig_file)
;`Noblank
;`P"- for switches options, the value is a JSON boolean (true or false, without quotes)"
;`Noblank
;`P"- for integers, the value is a JSON integer (without quotes)"
;`Noblank
;`P"- string options have string values"
;`Noblank
;`P
(Printf.sprintf
"- path options have string values, and are interpreted relative to the location of the %s file"
inferconfig_file)
;`Noblank
;`P"- cumulative options are JSON arrays of the appropriate type"
;`P
(Printf.sprintf
"Infer will look for an $(b,%s) file in the current directory, then its parent, etc., stopping at the first $(b,%s) file found."
"Given two infer reports $(i,previous) and $(i,current), compute the following three reports and store them inside the \"differential/\" subdirectory of the results directory:"
;`Noblank
;`P
"- $(b,introduced.json) contains the issues found in $(i,current) but not $(i,previous);"
;`Noblank
;`P"- $(b,fixed.json) contains the issues found in $(i,previous) but not $(i,current);"
;`Noblank
;`P
"- $(b,preexisting.json) contains the issues found in both $(i,previous) and $(i,current)."
;`P"All three files follow the same format as normal infer reports."]