From 9517c37a8c2319be620d304db0d5b11d398057be Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Wed, 29 Jun 2016 17:43:27 +0200 Subject: Update release notes --- lib/dialyzer/doc/src/notes.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index a5a52fee61..6400072b1f 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,20 @@

This document describes the changes made to the Dialyzer application.

+
Dialyzer 3.0.1 + +
Fixed Bugs and Malfunctions + + +

Fix a map related bug.

+

+ Own Id: OTP-13709 Aux Id: ERL-177, PR-1115

+
+
+
+ +
+
Dialyzer 3.0
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 37e14c395a0d3621d65552b3954856d1cbeaed9a Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 20 Sep 2016 09:36:54 +0200 Subject: Prepare release --- lib/dialyzer/doc/src/notes.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index 6400072b1f..b0f0a9aef0 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,29 @@

This document describes the changes made to the Dialyzer application.

+
Dialyzer 3.0.2 + +
Improvements and New Features + + +

The translation of forms to types is improved for + opaque types in a few cases.

+

+ Own Id: OTP-13682

+
+ +

Add warning suppression to compiler-generated case + statements. Warnings about clauses that cannot match and + are also compiler generated are suppressed unless none of + the clauses return.

+

+ Own Id: OTP-13723 Aux Id: ERL-159, PR-1121

+
+
+
+ +
+
Dialyzer 3.0.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 9f1f9179fb02fd2381e01c7960c082182176fabe Mon Sep 17 00:00:00 2001 From: xsipewe Date: Wed, 21 Sep 2016 12:50:46 +0200 Subject: Update Dialyzer documentation Language cleaned up by the technical writer xsipewe from Combitech. Proofreading and corrections by Hans Bolinder. --- lib/dialyzer/doc/src/book.xml | 2 +- lib/dialyzer/doc/src/dialyzer.xml | 828 +++++++++++++++++------------- lib/dialyzer/doc/src/dialyzer_chapter.xml | 303 +++++------ lib/dialyzer/doc/src/part.xml | 3 +- lib/dialyzer/doc/src/ref_man.xml | 3 +- 5 files changed, 643 insertions(+), 496 deletions(-) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/book.xml b/lib/dialyzer/doc/src/book.xml index aecc0e5bfa..46df8b81b8 100644 --- a/lib/dialyzer/doc/src/book.xml +++ b/lib/dialyzer/doc/src/book.xml @@ -25,7 +25,7 @@ Dialyzer - + 2016-09-19 book.xml diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml index 619db125b1..553bfef41b 100644 --- a/lib/dialyzer/doc/src/dialyzer.xml +++ b/lib/dialyzer/doc/src/dialyzer.xml @@ -4,7 +4,7 @@
- 20062015 + 20062016 Ericsson AB. All Rights Reserved. @@ -25,341 +25,477 @@ dialyzer - + 2016-09-20 + dialyzer.xml
dialyzer - The Dialyzer, a DIscrepancy AnalYZer for ERlang programs + Dialyzer, a DIscrepancy AnaLYZer for ERlang programs. + -

The Dialyzer is a static analysis tool that identifies software - discrepancies such as definite type errors, code which has become - dead or unreachable due to some programming error, unnecessary - tests, etc. in single Erlang modules or entire (sets of) - applications. Dialyzer starts its analysis from either - debug-compiled BEAM bytecode or from Erlang source code. The file - and line number of a discrepancy is reported along with an - indication of what the discrepancy is about. Dialyzer bases its - analysis on the concept of success typings which allows for sound - warnings (no false positives).

-

Read more about Dialyzer and about how to use it from the GUI - in Dialyzer User's - Guide.

+

Dialyzer is a static analysis tool that identifies software + discrepancies, such as definite type errors, code that has become dead + or unreachable because of programming error, and unnecessary tests, + in single Erlang modules or entire (sets of) applications.

+ +

Dialyzer starts its analysis from either + debug-compiled BEAM bytecode or from Erlang source code. The file + and line number of a discrepancy is reported along with an + indication of what the discrepancy is about. Dialyzer bases its + analysis on the concept of success typings, which allows for sound + warnings (no false positives).

- Using the Dialyzer from the command line -

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:

+ + Using Dialyzer from the Command Line +

Dialyzer has a command-line version for automated use. This + section provides a brief description of the options. The same information + can be obtained by writing the following in a shell:

+ - 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. -

Usage:

+dialyzer --help + +

For more details about the operation of Dialyzer, see section + + Using Dialyzer from the GUI in the User's Guide.

+ +

Exit status of the command-line version:

+ + + 0 + +

No problems were found during the analysis and no warnings were + emitted.

+
+ 1 + +

Problems were found during the analysis.

+
+ 2 + +

No problems were found during the analysis, 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]* [--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] - [--dump_callgraph file] [--no_native] [--fullpath] - [--statistics] [--no_native_cache] -

Options:

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

* denotes that multiple occurrences of the option are possible.

+
+ +

Options:

+ - (for backwards compatibility also - 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 - analysis. - - Same as the previous but the specified directories are searched - recursively for subdirectories containing or - files in them, depending on the type of - analysis. - - Option typically used when building or modifying a plt as in: + --add_to_plt + +

The PLT is extended to also include the files specified with + -c and -r. Use + --plt to specify which PLT to start from, + and --output_plt to specify where to put the PLT. + Notice that the analysis possibly can include files from the PLT if + they depend on the new files. This option only works for BEAM + files.

+
+ --apps applications + +

This option is 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 --build_plt --apps erts kernel stdlib mnesia ... +

to refer conveniently to library applications corresponding to the + Erlang/OTP installation. However, this option is general and can also + be used during analysis to refer to Erlang/OTP applications. + 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 - results to the specified outfile rather than to stdout. - - When using Dialyzer from the command line, output the raw analysis - results (Erlang terms) instead of the formatted result. The raw format - is easier to post-process (for instance, to filter warnings or to - output HTML pages). - - Override the default, which is to analyze BEAM files, and - analyze starting from Erlang source code instead. - (or ) - When analyzing from source, pass the define to Dialyzer. (**) - - When analyzing from source, pass the - to Dialyzer. (**) - - Include in the path for Erlang (useful when - analyzing files that have - directives). - - Store the plt at the specified file after building it. - - Use the specified plt as the initial plt (if the plt was built - during setup the files will be checked for consistency). - - Merge the specified plts to create the initial plt -- requires - 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 --apps inets ssl ./ebin ../other_lib/ebin/my_module.beam + + --build_plt + +

The analysis starts from an empty PLT and creates a new one from + the files specified with -c and + -r. This option only works for BEAM files. + To override the default PLT location, use + --plt or --output_plt.

+
+ --check_plt + +

Check the PLT for consistency and rebuild it if it is not + up-to-date.

+
+ -Dname (or -Dname=value) + +

When analyzing from source, pass the define to Dialyzer. + (**)

+
+ --dump_callgraph file + +

Dump the call graph into the specified file whose format is + determined by the filename extension. Supported extensions are: + raw, dot, and ps. If something else is used as + filename extension, default format .raw is used.

+
+ files_or_dirs (for backward compatibility also + as -c files_or_dirs) + +

Use Dialyzer from the command line to detect defects in the + specified files or directories containing .erl or + .beam files, depending on the type of the + analysis.

+
+ --fullpath + +

Display the full path names of files for which warnings are + emitted.

+
+ --get_warnings + +

Make Dialyzer emit warnings even when manipulating the PLT. + Warnings are only emitted for files that are analyzed.

+
+ --gui + +

Use the GUI.

+ --help (or -h) + +

Print this message and exit.

+
+ -I include_dir + +

When analyzing from source, pass the include_dir + to Dialyzer. (**)

+
+ --no_check_plt + +

Skip the PLT check when running Dialyzer. This is useful when + working with installed PLTs that never change.

+
+ --no_native (or -nn) + +

Bypass the native code compilation of some key files that + Dialyzer heuristically performs when dialyzing many files. + This avoids the compilation time, but can result in (much) longer + analysis time.

+
+ --no_native_cache + +

By default, Dialyzer caches the results of native compilation + in directory $XDG_CACHE_HOME/erlang/dialyzer_hipe_cache. + XDG_CACHE_HOME defaults to $HOME/.cache. + Use this option to disable caching.

+
+ -o outfile (or + --output outfile) + +

When using Dialyzer from the command line, send the analysis + results to the specified outfile rather than to stdout.

+
+ --output_plt file + +

Store the PLT at the specified file after building it.

+
+ -pa dir + +

Include dir in the path for Erlang. This is useful + when analyzing files that have -include_lib() + directives.

+
+ --plt plt + +

Use the specified PLT as the initial PLT. If the PLT was built + during setup, the files are checked for consistency.

+
+ --plt_info + +

Make Dialyzer print information about the PLT and then quit. + The PLT can be specified with --plt(s).

+
+ --plts plt* + +

Merge the specified PLTs to create the initial PLT. This requires + that the PLTs are disjoint (that is, 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 - and then can be used in either of the following ways: +dialyzer --build_plt --output_plt plt_1 files_to_include +... +dialyzer --build_plt --output_plt plt_n files_to_include +

They can then be used in either of the following ways:

- dialyzer files_to_analyze --plts plt_1 ... plt_n - or: +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() attribute. See Requesting or Suppressing Warnings in - Source Files below for details. - - Do not disable the Erlang shell while running the GUI. - (or ) - Print the Dialyzer version and some more information and - exit. - (or ) - Print this message and exit. - (or ) - Make Dialyzer a bit more quiet. - - Make Dialyzer a bit more verbose. - - Prints information about the progress of execution (analysis phases, - time spent in each and size of the relative input). - - The analysis starts from an empty plt and creates a new one from - the files specified with and - . Only works for beam files. Use - or to - override the default plt location. - - The plt is extended to also include the files specified with - and . Use - to specify which plt to start from, - and to specify where to put the plt. - Note that the analysis might include files from the plt if they depend - on the new files. This option only works with beam files. - - The information from the files specified with - and is removed - from the plt. Note that this may cause a re-analysis of the remaining - dependent files. - - Check the plt for consistency and rebuild it if it is not - up-to-date. - - Skip the plt check when running Dialyzer. Useful when working with - installed plts that never change. - - Make Dialyzer print information about the plt and then quit. The - plt can be specified with . - - Make Dialyzer emit warnings even when manipulating the plt. - Warnings are only emitted for files that are actually analyzed. - - Dump the call graph into the specified file whose format is - determined by the file name extension. Supported extensions are: raw, - dot, and ps. If something else is used as file name extension, default - format '.raw' will be used. - (or ) - Bypass the native code compilation of some key files that Dialyzer - heuristically performs when dialyzing many files; this avoids the - compilation time but it may result in (much) longer analysis - time. - - By default, Dialyzer caches the results of native compilation in the - $XDG_CACHE_HOME/erlang/dialyzer_hipe_cache directory. - XDG_CACHE_HOME defaults to $HOME/.cache. - Use this option to disable caching. - - Display the full path names of files for which warnings are emitted. - - Use the GUI. +dialyzer --plts plt_1 ... plt_n -- files_to_analyze +

Notice the -- delimiter in the second case.

+
+ --quiet (or -q) + +

Make Dialyzer a bit more quiet.

+
+ -r dirs + +

Same as files_or_dirs, but the specified + directories are searched + recursively for subdirectories containing .erl or + .beam files in them, depending on the type of + analysis.

+
+ --raw + +

When using Dialyzer from the command line, output the raw + analysis results (Erlang terms) instead of the formatted result. + The raw format + is easier to post-process (for example, to filter warnings or to + output HTML pages).

+
+ --remove_from_plt + +

The information from the files specified with + -c and -r is removed from + the PLT. Notice that this can cause a reanalysis of the remaining + dependent files.

+
+ --shell + +

Do not disable the Erlang shell while running the GUI.

+
+ --src + +

Override the default, which is to analyze BEAM files, and + analyze starting from Erlang source code instead.

+
+ --statistics + +

Print information about the progress of execution (analysis phases, + time spent in each, and size of the relative input).

+
+ --verbose + +

Make Dialyzer a bit more verbose.

+
+ --version (or -v) + +

Print the Dialyzer version and some more information and + exit.

+
+ -Wwarn + +

A family of options that selectively turn on/off warnings. + (For help on the names of warnings, use + dialyzer -Whelp.) + Notice that the options can also be specified in the file with a + -dialyzer() attribute. For details, see section Requesting or Suppressing Warnings in + Source Files.

+
+ -

* denotes that multiple occurrences of these options are possible.

-

** options and work both from command-line and in the Dialyzer GUI; - the syntax of defines and includes is the same as that used by .

+

** options -D and -I work both + from the command line and in the Dialyzer GUI; the syntax of + defines and includes is the same as that used by + erlc(1).

-

Warning options:

+ +

Warning options:

+ - - Suppress warnings for functions that will never return a - value. - - Suppress warnings for unused functions. - - Suppress warnings for construction of improper lists. - - Suppress warnings for fun applications that will fail. - - Suppress warnings for patterns that are unused or cannot - 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 calls to missing functions. - - 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 - value(s). - *** - Include warnings for functions that only return by means of an - exception. - *** - Include warnings for possible race conditions. Note that the - analysis that finds data races performs intra-procedural data flow analysis - and can sometimes explode in time. Enable it at your own risk. - - *** - Warn about underspecified functions - (the -spec is strictly more allowing than the success typing). - *** - Let warnings about unknown functions and types affect the - exit status of the command line version. The default is to ignore - warnings about unknown functions and types when setting the exit - status. When using the Dialyzer from Erlang, warnings about unknown - functions and types are returned; the default is not to return - these warnings. + -Werror_handling (***) + +

Include warnings for functions that only return by an exception.

+
+ -Wno_behaviours + +

Suppress warnings about behavior callbacks that drift from the + published recommended interfaces.

+
+ -Wno_contracts + +

Suppress warnings about invalid contracts.

+
+ -Wno_fail_call + +

Suppress warnings for failing calls.

+
+ -Wno_fun_app + +

Suppress warnings for fun applications that will fail.

+
+ -Wno_improper_lists + +

Suppress warnings for construction of improper lists.

+
+ -Wno_match + +

Suppress warnings for patterns that are unused or cannot match.

+
+ -Wno_missing_calls + +

Suppress warnings about calls to missing functions.

+
+ -Wno_opaque + +

Suppress warnings for violations of opaqueness of data types.

+
+ -Wno_return + +

Suppress warnings for functions that will never return a value.

+
+ -Wno_undefined_callbacks + +

Suppress warnings about behaviors that have no + -callback attributes for their callbacks.

+
+ -Wno_unused + +

Suppress warnings for unused functions.

+
+ -Wrace_conditions (***) + +

Include warnings for possible race conditions. Notice that the + analysis that finds data races performs intra-procedural data flow + analysis and can sometimes explode in time. Enable it at your own + risk.

+
+ -Wunderspecs (***) + +

Warn about underspecified functions (the specification is strictly + more allowing than the success typing).

+
+ -Wunknown (***) + +

Let warnings about unknown functions and types affect the + exit status of the command-line version. The default is to ignore + warnings about unknown functions and types when setting the exit + status. When using Dialyzer from Erlang, warnings about unknown + functions and types are returned; the default is not to return + these warnings.

+
+ -Wunmatched_returns (***) + +

Include warnings for function calls that ignore a structured return + value or do not match against one of many possible return + value(s).

+
-

The following options are also available but their use is not - recommended: (they are mostly for Dialyzer developers and internal - debugging)

+ +

The following options are also available, but their use is not + recommended (they are mostly for Dialyzer developers and internal + debugging):

+ - *** - Warn about overspecified functions - (the -spec is strictly less allowing than the success typing). - *** - Warn when the -spec is different than the success typing. + -Woverspecs (***) + +

Warn about overspecified functions (the specification is strictly + less allowing than the success typing).

+
+ -Wspecdiffs (***) + +

Warn when the specification is different than the success typing.

+
+ -

*** Identifies options that turn on warnings rather than - turning them off.

+

*** denotes options that turn on warnings rather than + turning them off.

- Using the Dialyzer from Erlang -

You can also use Dialyzer directly from Erlang. Both the GUI and the - command line versions are available. The options are similar to the ones - given from the command line, so please refer to the sections above for - a description of these.

+ Using Dialyzer from Erlang +

Dialyzer can be used directly from Erlang. Both the GUI and the + command-line versions are also available. The options are similar to the + ones given from the command line, see section + + Using Dialyzer from the Command Line.

Requesting or Suppressing Warnings in Source Files -

- The -dialyzer() attribute can be used for turning off +

Attribute -dialyzer() can be used for turning off warnings in a module by specifying functions or warning options. For example, to turn off all warnings for the function - f/0, include the following line: -

- --dialyzer({nowarn_function, f/0}). - + f/0, include the following line:

+ + +-dialyzer({nowarn_function, f/0}). +

To turn off warnings for improper lists, add the following line - to the source file: -

- --dialyzer(no_improper_lists). - -

The -dialyzer() attribute is allowed after function - declarations. Lists of warning options or functions are allowed: -

- --dialyzer([{nowarn_function, [f/0]}, no_improper_lists]). - -

- Warning options can be restricted to functions: -

- --dialyzer({no_improper_lists, g/0}). - - --dialyzer({[no_return, no_match], [g/0, h/0]}). - -

- For help on the warning options use dialyzer -Whelp. The - options are also enumerated below (WarnOpts). -

+ to the source file:

+ + +-dialyzer(no_improper_lists). + +

Attribute -dialyzer() is allowed after function + declarations. Lists of warning options or functions are allowed:

+ + +-dialyzer([{nowarn_function, [f/0]}, no_improper_lists]). + +

Warning options can be restricted to functions:

+ + +-dialyzer({no_improper_lists, g/0}). + + +-dialyzer({[no_return, no_match], [g/0, h/0]}). + +

For help on the warning options, use dialyzer -Whelp. The + options are also enumerated, see function + gui/1 below (WarnOpts).

+ -

- The -dialyzer() attribute is not checked by the Erlang - Compiler, but by the Dialyzer itself. -

+

Attribute -dialyzer() is not checked by the Erlang + compiler, but by Dialyzer itself.

+ -

- The warning option -Wrace_conditions has no effect when - set in source files. -

+

Warning option -Wrace_conditions has no effect when + set in source files.

-

- The -dialyzer() attribute can also be used for turning on - warnings. For instance, if a module has been fixed regarding - unmatched returns, adding the line -

- --dialyzer(unmatched_returns). - -

- can help in assuring that no new unmatched return warnings are - introduced. -

+ +

Attribute -dialyzer() can also be used for turning on + warnings. For example, if a module has been fixed regarding + unmatched returns, adding the following line can help in assuring + that no new unmatched return warnings are introduced:

+ + +-dialyzer(unmatched_returns).
+ + format_warning(Msg) -> string() + Get the string version of a warning message. + + Msg = {Tag, Id, msg()} + See run/1. + + +

Get a string from warnings as returned by + run/1.

+
+
+ gui() -> ok | {error, Msg} gui(OptList) -> ok | {error, Msg} - Dialyzer GUI version + Dialyzer GUI version. - OptList -- see below + OptList + See below.

Dialyzer GUI version.

@@ -368,9 +504,12 @@ 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 - | {plts, [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()} | {output_plt, FileName :: string()} @@ -383,76 +522,71 @@ Option :: {files, [Filename :: string()]} | {warnings, [WarnOpts]} | {get_warnings, bool()} -WarnOpts :: no_return - | no_unused - | no_improper_lists +WarnOpts :: error_handling + | no_behaviours + | no_contracts + | no_fail_call | no_fun_app + | no_improper_lists | no_match + | no_missing_calls | no_opaque - | no_fail_call - | no_contracts - | no_behaviours + | no_return | no_undefined_callbacks - | unmatched_returns - | error_handling + | no_unused | race_conditions - | overspecs | underspecs - | specdiffs - | unknown + | unknown + | unmatched_returns + | overspecs + | specdiffs
+ - run(OptList) -> Warnings - Dialyzer command line version - - OptList -- see gui/0,1 - Warnings -- see below - + plt_info(string()) -> {'ok', [{atom(), any()}]} | {'error', atom()} + Return information about the specified PLT. -

Dialyzer command line version.

- -Warnings :: [{Tag, Id, Msg}] -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' - | 'warn_unknown' -Id = {File :: string(), Line :: integer()} -Msg = msg() -- Undefined +

Returns information about the specified PLT.

+ - format_warning(Msg) -> string() - Get the string version of a warning message. + run(OptList) -> Warnings + Dialyzer command-line version. - Msg = {Tag, Id, msg()} -- See run/1 + OptList + See gui/0,1. + Warnings + See below. -

Get a string from warnings as returned by dialyzer:run/1.

-
-
- - plt_info(string()) -> {'ok', [{atom(), any()}]} | {'error', atom()} - Returns information about the specified plt. - -

Returns information about the specified plt.

+

Dialyzer command-line version.

+ +Warnings :: [{Tag, Id, Msg}] +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' + | 'warn_unknown' +Id = {File :: string(), Line :: integer()} +Msg = msg() -- Undefined
diff --git a/lib/dialyzer/doc/src/dialyzer_chapter.xml b/lib/dialyzer/doc/src/dialyzer_chapter.xml index c445f2633f..b5acf3732e 100644 --- a/lib/dialyzer/doc/src/dialyzer_chapter.xml +++ b/lib/dialyzer/doc/src/dialyzer_chapter.xml @@ -25,196 +25,211 @@ Dialyzer - + 2016-09-19 dialyzer_chapter.xml
Introduction -

Dialyzer is a static analysis tool that identifies software discrepancies - such as type errors, unreachable code, unnecessary tests, etc in single Erlang modules - or entire (sets of) applications.

-
- -
- Using the Dialyzer from the GUI -
- Choosing the applications or modules -

In the "File" window you will find a listing of the current directory. - Click your way to the directories/modules you want to add or type the - correct path in the entry.

-

Mark the directories/modules you want to analyze for discrepancies and - click "Add". You can either add the and -files directly, or - you can add directories that contain these kinds of files. Note that - you are only allowed to add the type of files that can be analyzed in - the current mode of operation (see below), and that you cannot mix - and -files.

+ Scope +

Dialyzer is a static analysis tool that identifies software + discrepancies, such as definite type errors, code that has become dead + or unreachable because of programming error, and unnecessary tests, + in single Erlang modules or entire (sets of) applications.

+ +

Dialyzer can be called from the command line, from Erlang, + and from a GUI.

- The analysis modes -

Dialyzer has two modes of analysis, "Byte Code" or "Source Code". - These are controlled by the buttons in the top-middle part of the - main window, under "Analysis Options".

-
- -
- Controlling the discrepancies reported by the Dialyzer -

Under the "Warnings" pull-down menu, there are buttons that control - which discrepancies are reported to the user in the "Warnings" window. - By clicking on these buttons, one can enable/disable a whole class of - warnings. Information about the classes of warnings can be found on - the "Warnings" item under the "Help" menu (at the rightmost top corner).

-

If modules are compiled with inlining, spurious warnings may be emitted. - In the "Options" menu you can choose to ignore inline-compiled modules - when analyzing byte code. When starting from source code this is not a - problem since the inlining is explicitly turned off by Dialyzer. The - option causes Dialyzer to suppress all warnings from inline-compiled - modules, since there is currently no way for Dialyzer to find what - parts of the code have been produced by inlining.

+ Prerequisites +

It is assumed that the reader is familiar with the Erlang programming + language.

+
-
- Running the analysis -

Once you have chosen the modules or directories you want to analyze, - click the "Run" button to start the analysis. If for some reason you - want to stop the analysis while it is running, push the "Stop" button.

-

The information from the analysis will be displayed in the Log and the - Warnings windows.

-
+
+ + The Persistent Lookup Table +

Dialyzer stores the result of an analysis in a Persistent + Lookup Table (PLT). The PLT can then be used as a starting + point for later analyses. It is recommended to build a PLT with the + Erlang/OTP applications that you are using, but also to include your + own applications that you are using frequently.

+ +

The PLT is built using option --build_plt to Dialyzer. + The following command builds the recommended minimal PLT for + Erlang/OTP:

-
- Include directories and macro definitions -

When analyzing from source you might have to supply Dialyzer with a - list of include directories and macro definitions (as you can do with - the flags and ). This can be done either by starting Dialyzer - with these flags from the command line as in:

- + +dialyzer --build_plt --apps erts kernel stdlib mnesia - dialyzer -I my_includes -DDEBUG -Dvsn=42 -I one_more_dir - -

or by adding these explicitly using the "Manage Macro Definitions" or - "Manage Include Directories" sub-menus in the "Options" menu.

-
+

Dialyzer looks if there is an environment variable called + DIALYZER_PLT and places the PLT at this location. If no such + variable is set, Dialyzer places the PLT at + $HOME/.dialyzer_plt. The placement can also be specified using + the options --plt or --output_plt.

-
- Saving the information on the Log and Warnings windows -

In the "File" menu there are options to save the contents of the Log - and the Warnings window. Just choose the options and enter the file to - save the contents in.

-

There are also buttons to clear the contents of each window.

-
+

Information can be added to an existing PLT using option + --add_to_plt. If you also want to include the Erlang compiler in + the PLT and place it in a new PLT, then use the following command:

-
- Inspecting the inferred types of the analyzed functions -

Dialyzer stores the information of the analyzed functions in a - Persistent Lookup Table (PLT). After an analysis you can inspect this - information. In the PLT menu you can choose to either search the PLT - or inspect the contents of the whole PLT. The information is presented - in edoc format.

-
-
+ +dialyzer --add_to_plt --apps compiler --output_plt my.plt -
- Using the Dialyzer from the command line -

See dialyzer(3).

-
+

Then you can add your favorite application my_app to the new + PLT:

-
- Using the Dialyzer from Erlang -

See dialyzer(3).

-
+ +dialyzer --add_to_plt --plt my.plt -r my_app/ebin -
- More on the Persistent Lookup Table (PLT) +

But you realize that it is unnecessary to have the Erlang compiler in this + one:

-

The persistent lookup table, or PLT, is used to store the - result of an analysis. The PLT can then be used as a starting - point for later analyses. It is recommended to build a PLT with - the otp applications that you are using, but also to include your - own applications that you are using frequently.

+ +dialyzer --remove_from_plt --plt my.plt --apps compiler -

The PLT is built using the --build_plt option to dialyzer. The - following command builds the recommended minimal PLT for OTP.

+

Later, when you have fixed a bug in your application my_app, + you want to update the PLT so that it becomes fresh the next time + you run Dialyzer. In this case, run the following command:

+dialyzer --check_plt --plt my.plt - dialyzer --build_plt -r $ERL_TOP/lib/stdlib/ebin\ - $ERL_TOP/lib/kernel/ebin \ - $ERL_TOP/lib/mnesia/ebin - +

Dialyzer then reanalyzes the changed files + and the files that depend on these files. Notice that this + consistency check is performed automatically the next time you + run Dialyzer with this PLT. Option --check_plt is only + for doing so without doing any other analysis.

-

Dialyzer will look if there is an environment variable called - $DIALYZER_PLT and place the PLT at this location. If no such - variable is set, Dialyzer will place the PLT at - $HOME/.dialyzer_plt. The placement can also be specified using the - --plt, or --output_plt options.

- -

You can also add information to an existing plt using the - --add_to_plt option. Suppose you want to also include the compiler - in the PLT and place it in a new PLT, then give the command

+

To get information about a PLT, use the following option:

+dialyzer --plt_info - dialyzer --add_to_plt -r $ERL_TOP/lib/compiler/ebin --output_plt my.plt - +

To specify which PLT, use option --plt.

-

Then you would like to add your favorite application my_app to - the new plt.

+

To get the output printed to a file, use option --output_file.

- +

Notice that when manipulating the PLT, no warnings are + emitted. To turn on warnings during (re)analysis of the PLT, use + option --get_warnings.

+
- dialyzer --add_to_plt --plt my.plt -r my_app/ebin - +
+ Using Dialyzer from the Command Line +

Dialyzer has a command-line version for automated use. + See dialyzer(3).

+
-

But you realize that it is unnecessary to have compiler in this one.

+
+ Using Dialyzer from Erlang +

Dialyzer can also be used directly from Erlang. + See dialyzer(3).

+
- +
+ + Using Dialyzer from the GUI +
+ Choosing the Applications or Modules +

The File window displays a listing of the current directory. + Click your way to the directories/modules you want to add or type the + correct path in the entry.

- dialyzer --remove_from_plt --plt my.plt -r $ERL_TOP/lib/compiler/ebin -
+

Mark the directories/modules you want to analyze for discrepancies and + click Add. You can either add the .beam and + .erl files directly, or add directories that contain + these kind of files. Notice that + you are only allowed to add the type of files that can be analyzed in + the current mode of operation (see below), and that you cannot mix + .beam and .erl files.

+
-

Later, when you have fixed a bug in your application my_app, - you want to update the plt so that it will be fresh the next time - you run Dialyzer, run the command

+
+ Analysis Modes +

Dialyzer has two analysis modes: "Byte Code" and "Source Code". + They are controlled by the buttons in the top-middle part of the + main window, under Analysis Options.

+
- +
+ Controlling the Discrepancies Reported by Dialyzer +

Under the Warnings pull-down menu, there are buttons that + control which discrepancies are reported to the user in the + Warnings window. By clicking these buttons, you can + enable/disable a whole class of warnings. Information about the classes + of warnings is found on the "Warnings" item under the Help + menu (in the rightmost top corner).

+ +

If modules are compiled with inlining, spurious warnings can be + emitted. In the Options menu you can choose to ignore + inline-compiled modules when analyzing byte code. + When starting from source code, this is not a problem because + inlining is explicitly turned off by Dialyzer. The option causes + Dialyzer to suppress all warnings from inline-compiled + modules, as there is currently no way for Dialyzer to find what + parts of the code have been produced by inlining.

+
- dialyzer --check_plt --plt my.plt -
+
+ Running the Analysis +

Once you have chosen the modules or directories you want to analyze, + click the Run button to start the analysis. If you for some + reason want to stop the analysis while it is running, click the + Stop button.

-

Dialyzer will then reanalyze the files that have been changed, - and the files that depend on these files. Note that this - consistency check will be performed automatically the next time - you run Dialyzer with this plt. The --check_plt option is merely - for doing so without doing any other analysis.

+

The information from the analysis is displayed in the Log + window and the Warnings window.

+
-

To get some information about a plt use the option

- +
+ Include Directories and Macro Definitions +

When analyzing from source, you might have to supply Dialyzer + with a list of include directories and macro definitions (as you can do + with the erlc flags + -I and -D). This can be done + either by starting Dialyzer with these flags from the command + line as in:

+ + +dialyzer -I my_includes -DDEBUG -Dvsn=42 -I one_more_dir - dialyzer --plt_info -
+

or by adding these explicitly using submenu + Manage Macro Definitions or + Manage Include Directories in the Options menu.

+
-

You can also specify which plt with the --plt option, and get the - output printed to a file with --output_file

+
+ Saving the Information on the Log and Warnings Windows +

The File menu includes options to save the contents of the + Log window and the Warnings window. Simply choose the + options and enter the file to save the contents in.

-

Note that when manipulating the plt, no warnings are - emitted. To turn on warnings during (re)analysis of the plt, use - the option --get_warnings.

+

There are also buttons to clear the contents of each window.

+
+
+ Inspecting the Inferred Types of the Analyzed Functions +

Dialyzer stores the information of the analyzed functions in a + Persistent Lookup Table (PLT), see section + The Persistent Lookup Table.

+ +

After an analysis, you can inspect this information. + In the PLT menu you can choose to either search the PLT + or inspect the contents of the whole PLT. The information is presented + in EDoc format.

+
- Feedback and bug reports -

At this point, we very much welcome user feedback (even wish-lists!). - If you notice something weird, especially if the Dialyzer reports any - discrepancy that is a false positive, please send an error report - describing the symptoms and how to reproduce them to:

- + Feedback and Bug Reports +

We very much welcome user feedback - even wishlists! + If you notice anything weird, especially if Dialyzer reports + any discrepancy that is a false positive, please send an error report + describing the symptoms and how to reproduce them.

diff --git a/lib/dialyzer/doc/src/part.xml b/lib/dialyzer/doc/src/part.xml index 575f77549a..9bfcf21a66 100644 --- a/lib/dialyzer/doc/src/part.xml +++ b/lib/dialyzer/doc/src/part.xml @@ -25,12 +25,11 @@ Dialyzer User's Guide - + 2016-09-19 part.xml -

Dialyzer is a static analysis tool that identifies software discrepancies such as type errors, unreachable code, unnecessary tests, etc in single Erlang modules or entire (sets of) applications.

diff --git a/lib/dialyzer/doc/src/ref_man.xml b/lib/dialyzer/doc/src/ref_man.xml index 01478cfb40..ddac047f2e 100644 --- a/lib/dialyzer/doc/src/ref_man.xml +++ b/lib/dialyzer/doc/src/ref_man.xml @@ -25,11 +25,10 @@ Dialyzer Reference Manual - + 2016-09-19 -

Dialyzer is a static analysis tool that identifies software discrepancies such as type errors, unreachable code, unnecessary tests, etc in single Erlang modules or entire (sets of) applications.

-- cgit v1.2.3 From a5f88f548c7f1045b5aa9642574167df899c2f3b Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 22 Nov 2016 10:20:55 +0100 Subject: dialyzer: Substitute 'opacity' for 'opaqueness' Suggested by Kostis. --- lib/dialyzer/doc/manual.txt | 2 +- lib/dialyzer/doc/src/dialyzer.xml | 2 +- lib/dialyzer/doc/src/notes.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/manual.txt b/lib/dialyzer/doc/manual.txt index be1fd2f8bc..a571cd2e2b 100644 --- a/lib/dialyzer/doc/manual.txt +++ b/lib/dialyzer/doc/manual.txt @@ -255,7 +255,7 @@ Warning options: -Wno_match Suppress warnings for patterns that are unused or cannot match. -Wno_opaque - Suppress warnings for violations of opaqueness of data types. + Suppress warnings for violations of opacity of data types. -Wunmatched_returns *** Include warnings for function calls which ignore a structured return value or do not match against one of many possible return value(s). diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml index 553bfef41b..4b7eb4ad68 100644 --- a/lib/dialyzer/doc/src/dialyzer.xml +++ b/lib/dialyzer/doc/src/dialyzer.xml @@ -346,7 +346,7 @@ dialyzer --plts plt_1 ... plt_n -- files_to_analyze -Wno_opaque -

Suppress warnings for violations of opaqueness of data types.

+

Suppress warnings for violations of opacity of data types.

-Wno_return diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index b0f0a9aef0..d86deba48d 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -522,7 +522,7 @@ or modifying opaque types within the scope of a module.

Hitherto the shape of terms (tuple, list, etc.) has been used to determine the opaque terms, but now the - contracts are used for decorating types with opaqueness. + contracts are used for decorating types with opacity.

Own Id: OTP-10397

@@ -1505,7 +1505,7 @@

The analysis accepts opaque type declarations and - detects violations of opaqueness of terms of such types. + detects violations of opacity of terms of such types. Starting with R13, many Erlang/OTP standard libraries (array, dict, digraph, ets, gb_sets, gb_trees, queue, and sets) contain opaque type declarations of their main data -- cgit v1.2.3 From fc0427be6d482182ec70f3cd87c73027cfb17ea9 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 9 Dec 2016 11:45:22 +0100 Subject: Prepare release --- lib/dialyzer/doc/src/notes.xml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index d86deba48d..54abd09504 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,37 @@

This document describes the changes made to the Dialyzer application.

+
Dialyzer 3.0.3 + +
Fixed Bugs and Malfunctions + + +

Fix bugs regarding opaque types.

+

+ Own Id: OTP-13693

+
+ +

Fix error handling of bad -dialyzer() + attributes.

+

+ Own Id: OTP-13979 Aux Id: ERL-283

+
+
+
+ + +
Improvements and New Features + + +

A few warning messages have been improved.

+

+ Own Id: OTP-11403

+
+
+
+ +
+
Dialyzer 3.0.2
Improvements and New Features -- cgit v1.2.3 From 4d658008be5a08ddadbe75ebadb9ef124436b76e Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 14 Mar 2017 15:59:23 +0100 Subject: Prepare release --- lib/dialyzer/doc/src/notes.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index 54abd09504..cd4ec4c068 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,48 @@

This document describes the changes made to the Dialyzer application.

+
Dialyzer 3.1 + +
Fixed Bugs and Malfunctions + + +

Fix a bug concerning parameterized opaque types.

+

+ Own Id: OTP-14130

+
+ +

Improve a few warnings. One of them could cause a + crash.

+

+ Own Id: OTP-14177

+
+ +

The dialyzer and observer applications will now use a + portable way to find the home directory. That means that + there is no longer any need to manually set the HOME + environment variable on Windows.

+

+ Own Id: OTP-14249 Aux Id: ERL-161

+
+
+
+ + +
Improvements and New Features + + +

The peak memory consumption is reduced.

The + evaluation of huge SCCs in dialyzer_typesig is + optimized.

Analyzing modules with binary + construction with huge strings is now much faster.

+

+ Own Id: OTP-14126 Aux Id: ERL-308

+
+
+
+ +
+
Dialyzer 3.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 3dd15a193e4a5aea1dd100d6a4e5ad3401334dfe Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 11 Apr 2017 13:06:50 +0200 Subject: stdlib: Add checks of the dialyzer attribute to the linter The same checks are also performed by the Dialyzer. --- lib/dialyzer/doc/src/dialyzer.xml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml index 4b7eb4ad68..e34ffd6def 100644 --- a/lib/dialyzer/doc/src/dialyzer.xml +++ b/lib/dialyzer/doc/src/dialyzer.xml @@ -4,7 +4,7 @@
- 20062016 + 20062017 Ericsson AB. All Rights Reserved. @@ -456,11 +456,6 @@ dialyzer --plts plt_1 ... plt_n -- files_to_analyze options are also enumerated, see function gui/1 below (WarnOpts).

- -

Attribute -dialyzer() is not checked by the Erlang - compiler, but by Dialyzer itself.

-
-

Warning option -Wrace_conditions has no effect when set in source files.

-- cgit v1.2.3 From 030e6ef2efaad12d485cec1727c4b68c09c6c584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 12 Apr 2017 15:19:23 +0200 Subject: Add back TypEr to the main OTP repository It turned out that the dependencies between Dialyzer and TypEr makes it impractical to have TypEr in a separate repository. Add it back to the OTP repository, but put the Erlang module 'typer' in the dialyzer application. --- lib/dialyzer/doc/src/Makefile | 2 +- lib/dialyzer/doc/src/ref_man.xml | 1 + lib/dialyzer/doc/src/typer.xml | 157 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 lib/dialyzer/doc/src/typer.xml (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/Makefile b/lib/dialyzer/doc/src/Makefile index 77d0a6fc68..8fe6cd30eb 100644 --- a/lib/dialyzer/doc/src/Makefile +++ b/lib/dialyzer/doc/src/Makefile @@ -34,7 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN) # Target Specs # ---------------------------------------------------- XML_APPLICATION_FILES = ref_man.xml -XML_REF3_FILES = dialyzer.xml +XML_REF3_FILES = dialyzer.xml typer.xml XML_PART_FILES = part.xml part_notes.xml XML_CHAPTER_FILES = dialyzer_chapter.xml notes.xml diff --git a/lib/dialyzer/doc/src/ref_man.xml b/lib/dialyzer/doc/src/ref_man.xml index ddac047f2e..d820fc5e00 100644 --- a/lib/dialyzer/doc/src/ref_man.xml +++ b/lib/dialyzer/doc/src/ref_man.xml @@ -31,5 +31,6 @@ + diff --git a/lib/dialyzer/doc/src/typer.xml b/lib/dialyzer/doc/src/typer.xml new file mode 100644 index 0000000000..abd7f07ccf --- /dev/null +++ b/lib/dialyzer/doc/src/typer.xml @@ -0,0 +1,157 @@ + + + + +
+ + 20062016 + Ericsson AB. All Rights Reserved. + + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + typer + + + 2017-04-13 + + type.xml +
+ typer + Typer, a Type annotator for ERlang programs. + + +

TypEr shows type information for Erlang modules to the user. + Additionally, it can annotate the code of files with such type + information.

+
+ +
+ + Using TypEr from the Command Line +

TypEr is used from the command-line. This section provides a + brief description of the options. The same information can be + obtained by writing the following in a shell:

+ + +typer --help + +

Usage:

+ + +typer [--help] [--version] [--plt PLT] [--edoc] + [--show | --show-exported | --annotate | --annotate-inc-files] + [-Ddefine]* [-I include_dir]* [-pa dir]* [-pz dir]* + [-T application]* [-r] file* + + +

* denotes that multiple occurrences of the option are possible.

+
+ +

Options:

+ + + + --r + +

Search directories recursively for .erl files below them.

+
+ --show + +

Print type specifications for all functions on stdout. + (This is the default behaviour; this option is not really + needed.)

+
+ + --show-exported (or show_exported) + +

Same as --show, but print specifications for + exported functions only. Specs are displayed sorted + alphabetically on the function's name.

+
+ + --annotate + +

Annotate the specified files with type specifications.

+
+ + --annotate-inc-files + +

Same as --annotate but annotates all + -include() files as well as all .erl files. (Use this + option with caution - it has not been tested much).

+
+ + --edoc + +

Print type information as Edoc @spec comments, not + as type specs.

+
+ + --plt + +

Use the specified dialyzer PLT file rather than the default one.

+
+ + -T file* + +

The specified file(s) already contain type specifications + and these are to be trusted in order to print specs for the + rest of the files. (Multiple files or dirs, separated by + spaces, can be specified.)

+
+ + -Dname (or -Dname=value) + +

Pass the defined name(s) to TypEr. (**)

+
+ + -I + +

Pass the include_dir to TypEr. (**)

+
+ + -pa dir + +

Include dir in the path for Erlang. This is useful + when analyzing files that have -include_lib() + directives or use parse transforms.

+
+ + -pz dir + +

Include dir in the path for Erlang. This is useful + when analyzing files that have -include_lib() + directives or use parse transforms.

+
+ + --version (or -v) + +

Print the TypEr version and some more information and + exit.

+
+ +
+ + +

** options -D and -I work both + from the command line and in the TypEr GUI; the syntax of + defines and includes is the same as that used by + erlc(1).

+
+ +
+ +
-- cgit v1.2.3 From 304fef65a147b53234d8d8ad8889ffa79d7ef45b Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 28 Apr 2017 15:11:53 +0200 Subject: Prepare release --- lib/dialyzer/doc/src/notes.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index cd4ec4c068..0dbee1ce34 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,22 @@

This document describes the changes made to the Dialyzer application.

+
Dialyzer 3.1.1 + +
Fixed Bugs and Malfunctions + + +

Report unknown types properly. A bug was introduced + in Erlang/OTP 19.3, where warnings about unknown types + were simply discarded.

+

+ Own Id: OTP-14368

+
+
+
+ +
+
Dialyzer 3.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 83e20c62057ebc1d8064bf57b01be560cd244e1d Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Thu, 4 May 2017 15:42:21 +0200 Subject: Update copyright year --- lib/dialyzer/doc/src/notes.xml | 2 +- lib/dialyzer/doc/src/ref_man.xml | 2 +- lib/dialyzer/doc/src/typer.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index 0dbee1ce34..f7613b3145 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20062016 + 20062017 Ericsson AB. All Rights Reserved. diff --git a/lib/dialyzer/doc/src/ref_man.xml b/lib/dialyzer/doc/src/ref_man.xml index d820fc5e00..d8cf324232 100644 --- a/lib/dialyzer/doc/src/ref_man.xml +++ b/lib/dialyzer/doc/src/ref_man.xml @@ -4,7 +4,7 @@
- 20062016 + 20062017 Ericsson AB. All Rights Reserved. diff --git a/lib/dialyzer/doc/src/typer.xml b/lib/dialyzer/doc/src/typer.xml index abd7f07ccf..1cfbe94807 100644 --- a/lib/dialyzer/doc/src/typer.xml +++ b/lib/dialyzer/doc/src/typer.xml @@ -4,7 +4,7 @@
- 20062016 + 20062017 Ericsson AB. All Rights Reserved. -- cgit v1.2.3 From dc57404252c47520f352834ad9be45ad684f96c9 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 4 May 2017 17:05:25 +0200 Subject: Prepare release --- lib/dialyzer/doc/src/notes.xml | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index f7613b3145..41f02ad752 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,56 @@

This document describes the changes made to the Dialyzer application.

+
Dialyzer 3.2 + +
Improvements and New Features + + +

+ Analyzing modules with binary construction with huge + strings is now much faster. The compiler also compiles + such modules slightly faster.

+

+ Own Id: OTP-14125 Aux Id: ERL-308

+
+ +

The peak memory consumption is reduced.

+

+ Own Id: OTP-14127

+
+ +

TypEr has been removed as separate application and is + now a part of the Dialyzer application. Documentation for + TypEr has been added in the Dialyzer application.

+

+ Own Id: OTP-14336

+
+ +

The format of debug information that is stored in BEAM + files (when debug_info is used) has been changed. + The purpose of the change is to better support other + BEAM-based languages such as Elixir or LFE.

+

All tools included in OTP (dialyzer, debugger, cover, + and so on) will handle both the new format and the + previous format. Tools that retrieve the debug + information using beam_lib:chunk(Beam, + [abstract_code]) will continue to work with both the + new and old format. Tools that call + beam_lib:chunk(Beam, ["Abst"]) will not work with + the new format.

+

For more information, see the description of + debug_info in the documentation for + beam_lib and the description of the + {debug_info,{Backend,Data}} option in the + documentation for compile.

+

+ Own Id: OTP-14369 Aux Id: PR-1367

+
+
+
+ +
+
Dialyzer 3.1.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From eace29905be436d77245656b2511c9a9c2c67c90 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Fri, 5 May 2017 13:15:42 +0200 Subject: Revert "Prepare release" This reverts commit dc57404252c47520f352834ad9be45ad684f96c9. --- lib/dialyzer/doc/src/notes.xml | 50 ------------------------------------------ 1 file changed, 50 deletions(-) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index 41f02ad752..f7613b3145 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,56 +32,6 @@

This document describes the changes made to the Dialyzer application.

-
Dialyzer 3.2 - -
Improvements and New Features - - -

- Analyzing modules with binary construction with huge - strings is now much faster. The compiler also compiles - such modules slightly faster.

-

- Own Id: OTP-14125 Aux Id: ERL-308

-
- -

The peak memory consumption is reduced.

-

- Own Id: OTP-14127

-
- -

TypEr has been removed as separate application and is - now a part of the Dialyzer application. Documentation for - TypEr has been added in the Dialyzer application.

-

- Own Id: OTP-14336

-
- -

The format of debug information that is stored in BEAM - files (when debug_info is used) has been changed. - The purpose of the change is to better support other - BEAM-based languages such as Elixir or LFE.

-

All tools included in OTP (dialyzer, debugger, cover, - and so on) will handle both the new format and the - previous format. Tools that retrieve the debug - information using beam_lib:chunk(Beam, - [abstract_code]) will continue to work with both the - new and old format. Tools that call - beam_lib:chunk(Beam, ["Abst"]) will not work with - the new format.

-

For more information, see the description of - debug_info in the documentation for - beam_lib and the description of the - {debug_info,{Backend,Data}} option in the - documentation for compile.

-

- Own Id: OTP-14369 Aux Id: PR-1367

-
-
-
- -
-
Dialyzer 3.1.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From eaf8ca41dfa4850437ad270d3897399c9358ced0 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 30 May 2017 16:15:30 +0200 Subject: Prepare release --- lib/dialyzer/doc/src/notes.xml | 63 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index f7613b3145..36ecc4a87b 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,69 @@

This document describes the changes made to the Dialyzer application.

+
Dialyzer 3.2 + +
Fixed Bugs and Malfunctions + + +

The check of bad type variables in type declarations + was mistakingly removed in Erlang/OTP 18, and is now + re-introduced.

+

+ Own Id: OTP-14423 Aux Id: OTP-14323

+
+
+
+ + +
Improvements and New Features + + +

+ Analyzing modules with binary construction with huge + strings is now much faster. The compiler also compiles + such modules slightly faster.

+

+ Own Id: OTP-14125 Aux Id: ERL-308

+
+ +

The peak memory consumption is reduced.

+

+ Own Id: OTP-14127

+
+ +

TypEr has been removed as separate application and is + now a part of the Dialyzer application. Documentation for + TypEr has been added in the Dialyzer application.

+

+ Own Id: OTP-14336

+
+ +

The format of debug information that is stored in BEAM + files (when debug_info is used) has been changed. + The purpose of the change is to better support other + BEAM-based languages such as Elixir or LFE.

+

All tools included in OTP (dialyzer, debugger, cover, + and so on) will handle both the new format and the + previous format. Tools that retrieve the debug + information using beam_lib:chunk(Beam, + [abstract_code]) will continue to work with both the + new and old format. Tools that call + beam_lib:chunk(Beam, ["Abst"]) will not work with + the new format.

+

For more information, see the description of + debug_info in the documentation for + beam_lib and the description of the + {debug_info,{Backend,Data}} option in the + documentation for compile.

+

+ Own Id: OTP-14369 Aux Id: PR-1367

+
+
+
+ +
+
Dialyzer 3.1.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 32275a2fc0b86d1f1b124706afc80f3ff92216eb Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Wed, 31 May 2017 16:21:00 +0200 Subject: Revert "Prepare release" This reverts commit eaf8ca41dfa4850437ad270d3897399c9358ced0. --- lib/dialyzer/doc/src/notes.xml | 63 ------------------------------------------ 1 file changed, 63 deletions(-) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index 36ecc4a87b..f7613b3145 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,69 +32,6 @@

This document describes the changes made to the Dialyzer application.

-
Dialyzer 3.2 - -
Fixed Bugs and Malfunctions - - -

The check of bad type variables in type declarations - was mistakingly removed in Erlang/OTP 18, and is now - re-introduced.

-

- Own Id: OTP-14423 Aux Id: OTP-14323

-
-
-
- - -
Improvements and New Features - - -

- Analyzing modules with binary construction with huge - strings is now much faster. The compiler also compiles - such modules slightly faster.

-

- Own Id: OTP-14125 Aux Id: ERL-308

-
- -

The peak memory consumption is reduced.

-

- Own Id: OTP-14127

-
- -

TypEr has been removed as separate application and is - now a part of the Dialyzer application. Documentation for - TypEr has been added in the Dialyzer application.

-

- Own Id: OTP-14336

-
- -

The format of debug information that is stored in BEAM - files (when debug_info is used) has been changed. - The purpose of the change is to better support other - BEAM-based languages such as Elixir or LFE.

-

All tools included in OTP (dialyzer, debugger, cover, - and so on) will handle both the new format and the - previous format. Tools that retrieve the debug - information using beam_lib:chunk(Beam, - [abstract_code]) will continue to work with both the - new and old format. Tools that call - beam_lib:chunk(Beam, ["Abst"]) will not work with - the new format.

-

For more information, see the description of - debug_info in the documentation for - beam_lib and the description of the - {debug_info,{Backend,Data}} option in the - documentation for compile.

-

- Own Id: OTP-14369 Aux Id: PR-1367

-
-
-
- -
-
Dialyzer 3.1.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From c18b13d4c8aa31b145703bbbf228fb07d6b2a0a5 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Wed, 21 Jun 2017 10:53:19 +0200 Subject: Prepare release --- lib/dialyzer/doc/src/notes.xml | 69 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) (limited to 'lib/dialyzer/doc') diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index f7613b3145..0d2cb6c4df 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,75 @@

This document describes the changes made to the Dialyzer application.

+
Dialyzer 3.2 + +
Fixed Bugs and Malfunctions + + +

The check of bad type variables in type declarations + was mistakingly removed in Erlang/OTP 18, and is now + re-introduced.

+

+ Own Id: OTP-14423 Aux Id: OTP-14323

+
+
+
+ + +
Improvements and New Features + + +

+ Analyzing modules with binary construction with huge + strings is now much faster. The compiler also compiles + such modules slightly faster.

+

+ Own Id: OTP-14125 Aux Id: ERL-308

+
+ +

The peak memory consumption is reduced.

+

+ Own Id: OTP-14127

+
+ +

Warnings about unknown types are now also generated + for types not used by any function specification.

+

+ Own Id: OTP-14218 Aux Id: OTP-14127

+
+ +

TypEr has been removed as separate application and is + now a part of the Dialyzer application. Documentation for + TypEr has been added in the Dialyzer application.

+

+ Own Id: OTP-14336

+
+ +

The format of debug information that is stored in BEAM + files (when debug_info is used) has been changed. + The purpose of the change is to better support other + BEAM-based languages such as Elixir or LFE.

+

All tools included in OTP (dialyzer, debugger, cover, + and so on) will handle both the new format and the + previous format. Tools that retrieve the debug + information using beam_lib:chunk(Beam, + [abstract_code]) will continue to work with both the + new and old format. Tools that call + beam_lib:chunk(Beam, ["Abst"]) will not work with + the new format.

+

For more information, see the description of + debug_info in the documentation for + beam_lib and the description of the + {debug_info,{Backend,Data}} option in the + documentation for compile.

+

+ Own Id: OTP-14369 Aux Id: PR-1367

+
+
+
+ +
+
Dialyzer 3.1.1
Fixed Bugs and Malfunctions -- cgit v1.2.3