From dc0d162fa9ad09d7942ef2f023f5fd8191178b07 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 21 Mar 2026 18:26:53 +0000 Subject: [PATCH] Report declaration position when warning about declaration after use. --- symbol_search.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/symbol_search.cc b/symbol_search.cc index 91f34c22d..1c51cccb6 100644 --- a/symbol_search.cc +++ b/symbol_search.cc @@ -175,6 +175,8 @@ bool symbol_search(const LineInfo*li, Design*des, NetScope*scope, cerr << li->get_fileline() << ": warning: net `" << path_tail.name << "` used before declaration." << endl; + cerr << net->get_fileline() + << ": : the net is declared here." << endl; // suppress further warnings for this net net->lexical_pos(lexical_pos); } @@ -195,6 +197,8 @@ bool symbol_search(const LineInfo*li, Design*des, NetScope*scope, cerr << li->get_fileline() << ": warning: event `" << path_tail.name << "` used before declaration." << endl; + cerr << eve->get_fileline() + << ": : the event is declared here." << endl; // suppress further warnings for this event eve->lexical_pos(lexical_pos); } @@ -216,6 +220,8 @@ bool symbol_search(const LineInfo*li, Design*des, NetScope*scope, cerr << li->get_fileline() << ": warning: parameter `" << path_tail.name << "` used before declaration." << endl; + cerr << par->get_fileline() + << ": : the parameter is declared here." << endl; // suppress further warnings for this parameter scope->set_parameter_lexical_pos(path_tail.name, lexical_pos); }