aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/compile/snmpc.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-07-19 15:39:11 +0200
committerMicael Karlberg <[email protected]>2011-07-19 15:39:11 +0200
commitf203698b44d50744a7543c79c936b148efd9e7ca (patch)
tree4c79fb4d59f7ff5c3b175597bc0d4ba35373f30f /lib/snmp/src/compile/snmpc.erl
parentd9f6226ed0d91c7f6339c63c65c0df63da89af24 (diff)
parentfc26533846df044af302e5f27363cb8025fa7151 (diff)
downloadotp-f203698b44d50744a7543c79c936b148efd9e7ca.tar.gz
otp-f203698b44d50744a7543c79c936b148efd9e7ca.tar.bz2
otp-f203698b44d50744a7543c79c936b148efd9e7ca.zip
[compiler] Added the option warnings_as_errors (for the SNMP MIB
compiler (escript) frontend, the option --wae is used) which specifies whether warnings should be treated as errors. Tuncer Ayaz. OTP-9437 Merge branch 'bmk/snmp/compiler/warnings_as_errors/OTP-9437' into bmk/snmp/snmp421_integration Conflicts: lib/snmp/doc/src/notes.xml lib/snmp/src/app/snmp.appup.src lib/snmp/src/compile/Makefile
Diffstat (limited to 'lib/snmp/src/compile/snmpc.erl')
-rw-r--r--lib/snmp/src/compile/snmpc.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/snmp/src/compile/snmpc.erl b/lib/snmp/src/compile/snmpc.erl
index 195c238184..5e6b81f1ec 100644
--- a/lib/snmp/src/compile/snmpc.erl
+++ b/lib/snmp/src/compile/snmpc.erl
@@ -108,6 +108,7 @@ compile(FileName) ->
%% {i, [import_dir_string()]} ["./"]
%% {il, [import_lib_dir_string()]} []
%% {warnings, bool()} true
+%% warnings_as_errors
%% {outdir, string()} "./"
%% description
%% reference
@@ -199,6 +200,8 @@ get_options([reference|Opts], Formats, Args) ->
get_options(Opts, ["~n reference"|Formats], Args);
get_options([{warnings, Val}|Opts], Formats, Args) ->
get_options(Opts, ["~n warnings: ~w"|Formats], [Val|Args]);
+get_options([warnings_as_errors|Opts], Formats, Args) ->
+ get_options(Opts, ["~n warnings_as_errors"|Formats], Args);
get_options([{verbosity, Val}|Opts], Formats, Args) ->
get_options(Opts, ["~n verbosity: ~w"|Formats], [Val|Args]);
get_options([imports|Opts], Formats, Args) ->
@@ -261,6 +264,8 @@ check_options([{group_check, Atom} | T]) when is_atom(Atom) ->
check_options([{warnings, Bool} | T]) ->
check_bool(warnings, Bool),
check_options(T);
+check_options([warnings_as_errors | T]) ->
+ check_options(T);
check_options([{db, volatile} | T]) ->
check_options(T);
check_options([{db, persistent} | T]) ->
@@ -331,6 +336,9 @@ get_agent_capabilities(Options) ->
get_module_compliance(Options) ->
get_bool_option(module_compliance, Options).
+get_warnings_as_errors(Options) ->
+ lists:member(warnings_as_errors, Options).
+
get_relaxed_row_name_assign_check(Options) ->
lists:member(relaxed_row_name_assign_check, Options).
@@ -409,6 +417,7 @@ init(From, MibFileName, Options) ->
put(reference, get_reference(Options)),
put(agent_capabilities, get_agent_capabilities(Options)),
put(module_compliance, get_module_compliance(Options)),
+ put(warnings_as_errors, get_warnings_as_errors(Options)),
File = filename:rootname(MibFileName, ".mib"),
put(filename, filename:basename(File ++ ".mib")),
R = case catch c_impl(File) of