Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
5793-dialyzer-Add-warning_options-no_missing_re...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5793-dialyzer-Add-warning_options-no_missing_return-and-n.patch of Package erlang
From f5270727f073cf738e21466559d27a84f674c1b0 Mon Sep 17 00:00:00 2001 From: Gonzalo Bella <gonzalobfmp@gmail.com> Date: Thu, 9 Jun 2022 11:06:26 +0100 Subject: [PATCH 3/3] dialyzer: Add warning_options `no_missing_return` and `no_extra_return` The options are documented in [1] (see `-Wno_extra_return` and `no_missing_return` but it is not allowed to use them in the code like `-dialyzer({no_extra_return, f/1}).` This commit add the options in dialyzer for skipping the warning for that funtion. [1] https://www.erlang.org/doc/man/dialyzer.html#using-dialyzer-from-the-command-line --- lib/dialyzer/src/dialyzer.hrl | 4 +++- lib/dialyzer/src/dialyzer_cl_parse.erl | 4 ++++ lib/stdlib/src/erl_lint.erl | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/dialyzer/src/dialyzer_cl_parse.erl b/lib/dialyzer/src/dialyzer_cl_parse.erl index b78bfd442d..c249d3b52b 100644 --- a/lib/dialyzer/src/dialyzer_cl_parse.erl +++ b/lib/dialyzer/src/dialyzer_cl_parse.erl @@ -570,4 +570,8 @@ They are primarily intended to be used with the -dialyzer attribute: -Wno_underspecs Suppress warnings about underspecified functions (those whose -spec is strictly more allowing than the success typing). + -Wno_extra_return + Suppress warnings about functions whose specification includes types that the function cannot return. + -Wno_missing_return + Suppress warnings about functions that return values that are not part of the specification. ". diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index c2a38ca441..1572a5508c 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -3439,7 +3439,7 @@ is_module_dialyzer_option(Option) -> no_behaviours,no_undefined_callbacks,unmatched_returns, error_handling,race_conditions,no_missing_calls, specdiffs,overspecs,underspecs,unknown, - no_underspecs + no_underspecs, no_extra_return, no_missing_return ]). %% try_catch_clauses(Scs, Ccs, In, ImportVarTable, State) -> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor