Less verbosity for IEEE warnings in earlier commit this rev.

This commit is contained in:
Wilson Snyder 2017-09-21 22:07:49 -04:00
parent 47e13cfdf4
commit 89f414b185
3 changed files with 11 additions and 4 deletions

View File

@ -139,7 +139,12 @@ V3Number::V3Number (FileLine* fileline, const char* sourcep) {
this->opAdd(product,addend);
if (product.bitsValue(width(), 4)) { // Overflowed
m_fileline->v3error("Too many digits for "<<width()<<" bit number: "<<sourcep);
if (!m_sized) m_fileline->v3error("As that number was unsized ('d...) it is limited to 32 bits (IEEE 2012 5.7.1)");
if (!m_sized) {
static int warned = false;
if (!warned++) {
m_fileline->v3error("As that number was unsized ('d...) it is limited to 32 bits (IEEE 2012 5.7.1)");
}
}
while (*(cp+1)) cp++; // Skip ahead so don't get multiple warnings
}
}

View File

@ -114,8 +114,11 @@ void yyerror(const char* errmsg) {
if (0==strncmp(errmsg, colonmsg, strlen(colonmsg))
&& PARSEP->prevBisonVal().token == yaID__ETC
&& PARSEP->curBisonVal().token == yP_COLONCOLON) {
PARSEP->fileline()->v3error("Perhaps '"+*PARSEP->prevBisonVal().strp
+"' is a package which needs to be predeclared? (IEEE 2012 26.3)");
static int warned = false;
if (!warned++) {
PARSEP->fileline()->v3error("Perhaps '"+*PARSEP->prevBisonVal().strp
+"' is a package which needs to be predeclared? (IEEE 2012 26.3)");
}
}
}

View File

@ -19,7 +19,6 @@ compile (
qq{%Error: t/t_lint_pkg_colon_bad.v:6: syntax error, unexpected ::, expecting ')' or ','
%Error: t/t_lint_pkg_colon_bad.v:6: Perhaps 'mispkg' is a package which needs to be predeclared? (IEEE 2012 26.3)
%Error: t/t_lint_pkg_colon_bad.v:7: syntax error, unexpected ::, expecting ',' or ';'
%Error: t/t_lint_pkg_colon_bad.v:7: Perhaps 'mispkgb' is a package which needs to be predeclared? (IEEE 2012 26.3)
}).'%Error: Exiting due to.*'
);