mirror of
https://github.com/verilator/verilator.git
synced 2025-01-05 22:27:35 +00:00
Add -Wno-lint
git-svn-id: file://localhost/svn/verilator/trunk/verilator@966 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
parent
10e34ca48e
commit
8075372675
@ -566,6 +566,17 @@ example C<-Werror-NOUNOPTFLAT>.
|
||||
|
||||
Disable the specified warning message.
|
||||
|
||||
=item -Wno-lint
|
||||
|
||||
Disable all lint related warning messages. This is equivelent to
|
||||
"-Wno-CASEINCOMPLETE -Wno-CASEOVERLAP -Wno-CASEX -Wno-CMPCONST
|
||||
-Wno-IMPLICIT -Wno-UNDRIVEN -Wno-UNSIGNED -Wno-UNUSED -Wno-VARHIDDEN
|
||||
-Wno-WIDTH".
|
||||
|
||||
It is strongly recommended you cleanup your code rather then using this
|
||||
option, it is only intended to be use when running test-cases of code
|
||||
received from third parties.
|
||||
|
||||
=item -x-assign 0
|
||||
|
||||
=item -x-assign 1
|
||||
|
@ -101,6 +101,13 @@ bool FileLine::warnOff(const string& msg, bool flag) {
|
||||
}
|
||||
}
|
||||
|
||||
void FileLine::warnLintOff(bool flag) {
|
||||
for (int codei=V3ErrorCode::FIRST_WARN; codei<V3ErrorCode::MAX; codei++) {
|
||||
V3ErrorCode code = (V3ErrorCode)codei;
|
||||
if (code.lintError()) warnOff(code, flag);
|
||||
}
|
||||
}
|
||||
|
||||
FileLine* FileLine::copyOrSameFileLine() {
|
||||
// Return this, or a copy of this
|
||||
// There are often more then one token per line, thus we use the
|
||||
|
@ -90,6 +90,13 @@ public:
|
||||
// Warnings we'll present to the user as errors
|
||||
// Later -Werror- options may make more of these.
|
||||
bool pretendError() const { return ( m_e==BLKANDNBLK || m_e==IMPURE); };
|
||||
// Warnings that are lint only
|
||||
bool lintError() const { return ( m_e==CASEINCOMPLETE || m_e==CASEOVERLAP
|
||||
|| m_e==CASEX || m_e==CMPCONST
|
||||
|| m_e==IMPLICIT
|
||||
|| m_e==UNDRIVEN || m_e==UNSIGNED
|
||||
|| m_e==UNUSED || m_e==VARHIDDEN
|
||||
|| m_e==WIDTH); };
|
||||
};
|
||||
inline bool operator== (V3ErrorCode lhs, V3ErrorCode rhs) { return (lhs.m_e == rhs.m_e); }
|
||||
inline bool operator== (V3ErrorCode lhs, V3ErrorCode::en rhs) { return (lhs.m_e == rhs); }
|
||||
@ -205,6 +212,7 @@ public:
|
||||
void warnOff(V3ErrorCode code, bool flag) { m_warnOff.set(code,flag); } // Turn on/off warning messages on this line.
|
||||
bool warnOff(const string& code, bool flag); // Returns 1 if ok
|
||||
bool warnIsOff(V3ErrorCode code);
|
||||
void warnLintOff(bool flag);
|
||||
void warnStateFrom(const FileLine& from) { m_warnOff=from.m_warnOff; }
|
||||
void warnResetDefault() { warnStateFrom(s_defaultFileLine); }
|
||||
|
||||
|
@ -440,9 +440,14 @@ void V3Options::parseOptsList(FileLine* fl, int argc, char** argv) {
|
||||
V3PreShell::undef (string (sw+strlen("-U")));
|
||||
}
|
||||
else if ( !strncmp (sw, "-Wno-",5) ) {
|
||||
string msg = sw+strlen("-Wno-");
|
||||
if (!(FileLine::defaultFileLine().warnOff(msg, true))) {
|
||||
fl->v3fatal("Unknown warning disabled: "<<sw);
|
||||
if (!strcmp (sw, "-Wno-lint")) {
|
||||
FileLine::defaultFileLine().warnLintOff(true);
|
||||
}
|
||||
else {
|
||||
string msg = sw+strlen("-Wno-");
|
||||
if (!(FileLine::defaultFileLine().warnOff(msg, true))) {
|
||||
fl->v3fatal("Unknown warning disabled: "<<sw);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( !strncmp (sw, "-Werror-",strlen("-Werror-")) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user