diff options
author | Micael Karlberg <[email protected]> | 2011-07-18 15:25:51 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-07-18 15:25:51 +0200 |
commit | cac2257eeee2158fc0348913a7551fd947f40787 (patch) | |
tree | b86bda17475f96b2fa53b1224171e00857f639ed /lib/snmp/src/compile/snmpc.erl | |
parent | 917ac0f91480757051b3644832e0bdbb5afd41b6 (diff) | |
download | otp-cac2257eeee2158fc0348913a7551fd947f40787.tar.gz otp-cac2257eeee2158fc0348913a7551fd947f40787.tar.bz2 otp-cac2257eeee2158fc0348913a7551fd947f40787.zip |
[compiler] Added the option warnings_as_errors which
specifies whether warnings should be treated as errors.
Tuncer Ayaz.
OTP-9437
Diffstat (limited to 'lib/snmp/src/compile/snmpc.erl')
-rw-r--r-- | lib/snmp/src/compile/snmpc.erl | 9 |
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 |