mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Add an URL on warnings to point to the manual's description.
This commit is contained in:
+11
-3
@@ -39,6 +39,7 @@ bool V3Error::s_errorSuppressed = false;
|
||||
std::array<bool, V3ErrorCode::_ENUM_MAX> V3Error::s_describedEachWarn;
|
||||
std::array<bool, V3ErrorCode::_ENUM_MAX> V3Error::s_pretendError;
|
||||
bool V3Error::s_describedWarnings = false;
|
||||
bool V3Error::s_describedWeb = false;
|
||||
V3Error::MessagesSet V3Error::s_messages;
|
||||
V3Error::ErrorExitCb V3Error::s_errorExitCb = nullptr;
|
||||
|
||||
@@ -225,13 +226,20 @@ void V3Error::v3errorEnd(std::ostringstream& sstr, const string& locationStr) {
|
||||
}
|
||||
if (!s_errorSuppressed
|
||||
&& !(s_errorCode == V3ErrorCode::EC_INFO || s_errorCode == V3ErrorCode::USERINFO)) {
|
||||
const bool anError = isError(s_errorCode, s_errorSuppressed);
|
||||
if (s_errorCode >= V3ErrorCode::EC_FIRST_NAMED && !s_describedWeb) {
|
||||
s_describedWeb = true;
|
||||
std::cerr << warnMore() << "... For " << (anError ? "error" : "warning")
|
||||
<< " description see https://verilator.org/warn/" << s_errorCode.ascii()
|
||||
<< "?v=" << PACKAGE_VERSION_NUMBER_STRING << endl;
|
||||
}
|
||||
if (!s_describedEachWarn[s_errorCode] && !s_pretendError[s_errorCode]) {
|
||||
s_describedEachWarn[s_errorCode] = true;
|
||||
if (s_errorCode >= V3ErrorCode::EC_FIRST_WARN && !s_describedWarnings) {
|
||||
s_describedWarnings = true;
|
||||
std::cerr << warnMore() << "... Use \"/* verilator lint_off "
|
||||
<< s_errorCode.ascii()
|
||||
<< " */\" and lint_on around source to disable this message." << endl;
|
||||
s_describedWarnings = true;
|
||||
}
|
||||
if (s_errorCode.dangerous()) {
|
||||
std::cerr << warnMore() << "*** See the manual before disabling this,\n";
|
||||
@@ -248,7 +256,7 @@ void V3Error::v3errorEnd(std::ostringstream& sstr, const string& locationStr) {
|
||||
s_tellManual = 2;
|
||||
}
|
||||
}
|
||||
if (isError(s_errorCode, s_errorSuppressed)) {
|
||||
if (anError) {
|
||||
incErrors();
|
||||
} else {
|
||||
incWarnings();
|
||||
@@ -276,7 +284,7 @@ void V3Error::v3errorEnd(std::ostringstream& sstr, const string& locationStr) {
|
||||
}
|
||||
|
||||
vlAbortOrExit();
|
||||
} else if (isError(s_errorCode, s_errorSuppressed)) {
|
||||
} else if (anError) {
|
||||
// We don't dump tree on any error because a Visitor may be in middle of
|
||||
// a tree cleanup and cause a false broken problem.
|
||||
if (s_errorExitCb) s_errorExitCb();
|
||||
|
||||
Reference in New Issue
Block a user