aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parsetools/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-09-09 08:16:55 +0200
committerHans Bolinder <[email protected]>2016-09-12 09:37:15 +0200
commitedaa208b4aa5e9e6e67df9eae4fa5e70791a7002 (patch)
tree6500135f707fa46991eaf5036a4a1f2471dc1663 /lib/parsetools/src
parent86d1fb0865193cce4e308baa6472885a81033f10 (diff)
downloadotp-edaa208b4aa5e9e6e67df9eae4fa5e70791a7002.tar.gz
otp-edaa208b4aa5e9e6e67df9eae4fa5e70791a7002.tar.bz2
otp-edaa208b4aa5e9e6e67df9eae4fa5e70791a7002.zip
parsetools: Suppress Dialyzer-warnings
When using Yecc's operator precedence declarations (Right, Nonassoc, Left), it is possible that some clauses of the generated code are unreachable. Dialyzer complains, at least if SET_LIMIT in erl_types is set sufficiently high (to avoid sets of integers to collapse to the integer() type). Rather than trying to figure out exactly which clauses are unreachable, Yecc generates a Dialyzer suppression.
Diffstat (limited to 'lib/parsetools/src')
-rw-r--r--lib/parsetools/src/yecc.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/parsetools/src/yecc.erl b/lib/parsetools/src/yecc.erl
index 1b426141a1..f6b80eb1b4 100644
--- a/lib/parsetools/src/yecc.erl
+++ b/lib/parsetools/src/yecc.erl
@@ -1978,7 +1978,8 @@ output_goto(St, [{_Nonterminal, []} | Go], StateInfo) ->
output_goto(St, Go, StateInfo);
output_goto(St0, [{Nonterminal, List} | Go], StateInfo) ->
F = function_name(yeccgoto, Nonterminal),
- St10 = output_goto1(St0, List, F, StateInfo, true),
+ St05 = fwrite(St0, <<"-dialyzer({nowarn_function, ~w/7}).\n">>, [F]),
+ St10 = output_goto1(St05, List, F, StateInfo, true),
St = output_goto_fini(F, Nonterminal, St10),
output_goto(St, Go, StateInfo);
output_goto(St, [], _StateInfo) ->