diff --git a/src/V3Number.cpp b/src/V3Number.cpp index dd7b662f4..5a804f92f 100644 --- a/src/V3Number.cpp +++ b/src/V3Number.cpp @@ -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 "<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 } } diff --git a/src/verilog.l b/src/verilog.l index 5786abbf3..decc4b8b0 100644 --- a/src/verilog.l +++ b/src/verilog.l @@ -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)"); + } } } diff --git a/test_regress/t/t_lint_pkg_colon_bad.pl b/test_regress/t/t_lint_pkg_colon_bad.pl index 313e7c3ce..decc210b4 100755 --- a/test_regress/t/t_lint_pkg_colon_bad.pl +++ b/test_regress/t/t_lint_pkg_colon_bad.pl @@ -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.*' );