With -Wpedantic change ASSIGNIN to a warning

This commit is contained in:
Wilson Snyder 2023-02-21 16:45:35 -05:00
parent 45f955f175
commit adf1de45de
3 changed files with 26 additions and 1 deletions

View File

@ -1530,6 +1530,8 @@ Summary:
:command:`gcc -Wpedantic`. Rarely used, and intended only for strict
compliance tests.
This option changes :option:`ASSIGNIN` from an error to a warning.
.. option:: -Wwarn-<message>
Enables the specified warning message.

View File

@ -1526,7 +1526,10 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
});
DECL_OPTION("-vpi", OnOff, &m_vpi);
DECL_OPTION("-Wpedantic", OnOff, &m_pedantic);
DECL_OPTION("-Wpedantic", CbCall, [this]() {
m_pedantic = true;
V3Error::pretendError(V3ErrorCode::ASSIGNIN, false);
});
DECL_OPTION("-Wall", CbCall, []() {
FileLine::globalWarnLintOff(false);
FileLine::globalWarnStyleOff(false);

View File

@ -0,0 +1,20 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2005 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.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(vlt => 1);
top_filename("t/t_var_in_assign_bad.v");
lint(
verilator_flags2 => ['-Wpedantic -Wno-fatal'],
);
ok(1);
1;