diff --git a/Changes b/Changes index 6316804ae..f583bc0c2 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,8 @@ indicates the contributor was also the author of the fix; Thanks! * Verilator 3.861 devel +*** Using command line -Wno-{WARNING} now overrides file-local lint_on. + *** Support SV 2012 package import before port list. **** Fix huge shifts to zero with -Wno-WIDTH, bug765. [Clifford Wolf] diff --git a/bin/verilator b/bin/verilator index 099d3bac7..b76322eba 100755 --- a/bin/verilator +++ b/bin/verilator @@ -1088,7 +1088,8 @@ supports which the older version does not support. =item -Wno-I -Disable the specified warning message. +Disable the specified warning message. This will override any lint_on +directives in the source, i.e. the warning will still not be printed. =item -Wno-lint @@ -1918,6 +1919,9 @@ Disables the specified lint warning, in the specified filename (or wildcard with '*' or '?', or all files if omitted) and range of line numbers (or all lines if omitted). +Using '*' will override any lint_on directives in the source, i.e. the +warning will still not be printed. + If the -msg is omitted, all lint warnings are disabled. This will override all later lint warning enables for the specified region. diff --git a/src/V3Error.cpp b/src/V3Error.cpp index d1e041d18..8eb7c5613 100644 --- a/src/V3Error.cpp +++ b/src/V3Error.cpp @@ -253,6 +253,7 @@ void FileLine::warnStyleOff(bool flag) { bool FileLine::warnIsOff(V3ErrorCode code) const { if (!m_warnOn.test(code)) return true; + if (!defaultFileLine().m_warnOn.test(code)) return true; // Global overrides local // UNOPTFLAT implies UNOPT if (code==V3ErrorCode::UNOPT && !m_warnOn.test(V3ErrorCode::UNOPTFLAT)) return true; if ((code.lintError() || code.styleError()) && !m_warnOn.test(V3ErrorCode::I_LINT)) return true; diff --git a/test_regress/t/t_flag_woff.pl b/test_regress/t/t_flag_woff.pl new file mode 100755 index 000000000..ad3f44ee8 --- /dev/null +++ b/test_regress/t/t_flag_woff.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2008 by Wilson Snyder. This program is free software; you can +# redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. + +$Self->{vlt} or $Self->skip("Verilator only test"); + +compile ( + v_flags2 => ["--lint-only -Wno-WIDTH"], + verilator_make_gcc => 0, + make_top_shell => 0, + make_main => 0, + ); + +ok(1); +1; diff --git a/test_regress/t/t_flag_woff.v b/test_regress/t/t_flag_woff.v new file mode 100644 index 000000000..6bef2db23 --- /dev/null +++ b/test_regress/t/t_flag_woff.v @@ -0,0 +1,20 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed into the Public Domain, for any use, +// without warranty, 2008 by Wilson Snyder. + +module t; + + // width warnings off due to command line + wire A = 15'd1234; + + // width warnings off due to command line + manual switch + // verilator lint_off WIDTH + wire B = 15'd1234; + + // this turnon does nothing as off on command line + // verilator lint_on WIDTH + wire C = 15'd1234; + +endmodule +