Clarify extern error message

This commit is contained in:
Wilson Snyder 2025-08-10 08:38:26 -04:00
parent 641dd756c0
commit eb80db9397
3 changed files with 7 additions and 5 deletions

View File

@ -3717,7 +3717,8 @@ class LinkDotResolveVisitor final : public VNVisitor {
}
if (nodep->isExternProto()) {
if (!m_curSymp->findIdFallback(nodep->name()) && nodep->isExternExplicit()) {
nodep->v3error("Definition not found for extern " + nodep->prettyNameQ());
nodep->v3error("Definition not found for extern prototype "
+ nodep->prettyNameQ());
}
}
VL_RESTORER(m_curSymp);
@ -4286,7 +4287,8 @@ class LinkDotResolveVisitor final : public VNVisitor {
}
if (nodep->isExternProto()) {
if (!m_curSymp->findIdFallback(nodep->name())) {
nodep->v3error("Definition not found for extern " + nodep->prettyNameQ());
nodep->v3error("Definition not found for extern prototype "
+ nodep->prettyNameQ());
}
}
VL_RESTORER(m_curSymp);

View File

@ -5,10 +5,10 @@
8 | extern task nodef();
| ^~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error: t/t_class_extern_bad.v:8:16: Definition not found for extern 'nodef'
%Error: t/t_class_extern_bad.v:8:16: Definition not found for extern prototype 'nodef'
8 | extern task nodef();
| ^~~~~
%Error: t/t_class_extern_bad.v:9:16: Definition not found for extern 'nodef'
%Error: t/t_class_extern_bad.v:9:16: Definition not found for extern prototype 'nodef'
9 | extern task nodef();
| ^~~~~
%Error: t/t_class_extern_bad.v:12:6: extern not found that declares 'noproto'

View File

@ -1,4 +1,4 @@
%Error: t/t_constraint_extern_bad.v:8:22: Definition not found for extern 'missing_bad'
%Error: t/t_constraint_extern_bad.v:8:22: Definition not found for extern prototype 'missing_bad'
8 | extern constraint missing_bad;
| ^~~~~~~~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.