From 0b0412383192ff40e80aec0ade4a8b0fe7e23e9b Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 28 May 2014 13:21:07 +0200 Subject: [dialyzer] Correct docs about options --- lib/dialyzer/doc/src/dialyzer.xml | 109 +++++++++++++++++++-------------- lib/dialyzer/src/dialyzer_cl_parse.erl | 13 ++-- 2 files changed, 71 insertions(+), 51 deletions(-) (limited to 'lib/dialyzer') diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml index a92b890a80..3de60b2f7a 100644 --- a/lib/dialyzer/doc/src/dialyzer.xml +++ b/lib/dialyzer/doc/src/dialyzer.xml @@ -4,7 +4,7 @@
- 20062013 + 20062014 Ericsson AB. All Rights Reserved. @@ -50,33 +50,31 @@

Dialyzer also has a command line version for automated use. Below is a brief description of the list of its options. The same information can be obtained by writing

- + + dialyzer --help

in a shell. Please refer to the GUI description for more details on the operation of Dialyzer.

The exit status of the command line version is:

- 0 - No problems were encountered during the analysis and no warnings were emitted. 1 - Problems were encountered during the analysis. - 2 - No problems were encountered, but warnings were emitted. - ]]> + 2 - No problems were encountered, but warnings were emitted.

Usage:

- dialyzer [--help] [--version] [--shell] [--quiet] [--verbose] [-pa dir]* [--plt plt] [--plts plt*] [-Ddefine]* - [-I include_dir]* [--output_plt file] [-Wwarn]* + [-I include_dir]* [--output_plt file] [-Wwarn]* [--raw] [--src] [--gui] [files_or_dirs] [-r dirs] [--apps applications] [-o outfile] [--build_plt] [--add_to_plt] [--remove_from_plt] [--check_plt] [--no_check_plt] [--plt_info] [--get_warnings] - [--no_native] [--fullpath] - ]]> + [--dump_callgraph file] [--no_native] [--fullpath] + [--statistics]

Options:

(for backwards compatibility also - as: + as: ) Use Dialyzer from the command line to detect defects in the specified files or directories containing or files, depending on the type of the @@ -88,16 +86,14 @@ analysis. Option typically used when building or modifying a plt as in: - + + dialyzer --build_plt --apps erts kernel stdlib mnesia ... to conveniently refer to library applications corresponding to the Erlang/OTP installation. However, the option is general and can also be used during analysis in order to refer to Erlang/OTP applications. In addition, file or directory names can also be included, as in: - + + dialyzer --apps inets ssl ./ebin ../other_lib/ebin/my_module.beam (or ) When using Dialyzer from the command line, send the analysis @@ -129,24 +125,26 @@ that the plts are disjoint (i.e., do not have any module appearing in more than one plt). The plts are created in the usual way: - dialyzer --build_plt --output_plt plt_1 files_to_include ... - dialyzer --build_plt --output_plt plt_n files_to_include - ]]> + dialyzer --build_plt --output_plt plt_n files_to_include and then can be used in either of the following ways: - + + dialyzer files_to_analyze --plts plt_1 ... plt_n or: - + + dialyzer --plts plt_1 ... plt_n -- files_to_analyze (Note the -- delimiter in the second case) A family of options which selectively turn on/off warnings (for help on the names of warnings use - ). + ). + Note that the options can also be given in the file with a + -dialyzer({nowarn_tag, WarningTags}) attribute. + See Erlang Reference + Manual for details. Do not disable the Erlang shell while running the GUI. (or ) @@ -220,8 +218,6 @@ Suppress warnings for unused functions. Suppress warnings for construction of improper lists. - - Suppress warnings for using tuples instead of funs. Suppress warnings for fun applications that will fail. @@ -229,9 +225,16 @@ match. Suppress warnings for violations of opaqueness of data types. + + Suppress warnings for failing calls. + + Suppress warnings about invalid contracts. Suppress warnings about behaviour callbacks which drift from the published recommended interfaces. + + Suppress warnings about behaviours that have no + -callback attributes for their callbacks. *** Include warnings for function calls which ignore a structured return value or do not match against one of many possible return @@ -278,13 +281,13 @@

Dialyzer GUI version.

- OptList :: [Option] Option :: {files, [Filename :: string()]} | {files_rec, [DirName :: string()]} | {defines, [{Macro: atom(), Value : term()}]} - | {from, src_code | byte_code} %% Defaults to byte_code - | {init_plt, FileName :: string()} %% If changed from default + | {from, src_code | byte_code} %% Defaults to byte_code + | {init_plt, FileName :: string()} %% If changed from default | {plts, [FileName :: string()]} %% If changed from default | {include_dirs, [DirName :: string()]} | {output_file, FileName :: string()} @@ -304,14 +307,15 @@ WarnOpts :: no_return | no_match | no_opaque | no_fail_call + | no_contracts + | no_behaviours + | no_undefined_callbacks + | unmatched_returns | error_handling | race_conditions - | behaviours - | unmatched_returns | overspecs | underspecs - | specdiffs - ]]> + | specdiffs
@@ -323,17 +327,30 @@ WarnOpts :: no_return

Dialyzer command line version.

- Warnings :: [{Tag, Id, Msg}] -Tag :: 'warn_return_no_exit' | 'warn_return_only_exit' - | 'warn_not_called' | 'warn_non_proper_list' - | 'warn_fun_app' | 'warn_matching' - | 'warn_failing_call' | 'warn_contract_types' - | 'warn_contract_syntax' | 'warn_contract_not_equal' - | 'warn_contract_subtype' | 'warn_contract_supertype' +Tag :: 'warn_behaviour' + | 'warn_bin_construction' + | 'warn_callgraph' + | 'warn_contract_not_equal' + | 'warn_contract_range' + | 'warn_contract_subtype' + | 'warn_contract_supertype' + | 'warn_contract_syntax' + | 'warn_contract_types' + | 'warn_failing_call' + | 'warn_fun_app' + | 'warn_matching' + | 'warn_non_proper_list' + | 'warn_not_called' + | 'warn_opaque' + | 'warn_race_condition' + | 'warn_return_no_exit' + | 'warn_return_only_exit' + | 'warn_umatched_return' + | 'warn_undefined_callbacks' Id = {File :: string(), Line :: integer()} -Msg = msg() -- Undefined -]]> +Msg = msg() -- Undefined
diff --git a/lib/dialyzer/src/dialyzer_cl_parse.erl b/lib/dialyzer/src/dialyzer_cl_parse.erl index db27b2037d..04ce0e8bc3 100644 --- a/lib/dialyzer/src/dialyzer_cl_parse.erl +++ b/lib/dialyzer/src/dialyzer_cl_parse.erl @@ -2,7 +2,7 @@ %%----------------------------------------------------------------------- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2013. All Rights Reserved. +%% Copyright Ericsson AB 2006-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -357,12 +357,13 @@ help_warnings() -> help_message() -> S = "Usage: dialyzer [--help] [--version] [--shell] [--quiet] [--verbose] [-pa dir]* [--plt plt] [--plts plt*] [-Ddefine]* - [-I include_dir]* [--output_plt file] [-Wwarn]* + [-I include_dir]* [--output_plt file] [-Wwarn]* [--raw] [--src] [--gui] [files_or_dirs] [-r dirs] [--apps applications] [-o outfile] [--build_plt] [--add_to_plt] [--remove_from_plt] [--check_plt] [--no_check_plt] [--plt_info] [--get_warnings] - [--no_native] [--fullpath] [--statistics] + [--dump_callgraph file] [--no_native] [--fullpath] + [--statistics] Options: files_or_dirs (for backwards compatibility also as: -c files_or_dirs) Use Dialyzer from the command line to detect defects in the @@ -495,14 +496,16 @@ warning_options_msg() -> Suppress warnings for unused functions. -Wno_improper_lists Suppress warnings for construction of improper lists. - -Wno_tuple_as_fun - Suppress warnings for using tuples instead of funs. -Wno_fun_app Suppress warnings for fun applications that will fail. -Wno_match Suppress warnings for patterns that are unused or cannot match. -Wno_opaque Suppress warnings for violations of opaqueness of data types. + -Wno_fail_call + Suppress warnings for failing calls. + -Wno_contracts + Suppress warnings about invalid contracts. -Wno_behaviours Suppress warnings about behaviour callbacks which drift from the published recommended interfaces. -- cgit v1.2.3