From e36564ff7332033a0ec650e2b8783097e7af73f0 Mon Sep 17 00:00:00 2001 From: Kamil Danecki Date: Tue, 31 Mar 2026 12:27:37 +0200 Subject: [PATCH] Add warning about setting lifetime to static Signed-off-by: Kamil Danecki --- src/V3LinkParse.cpp | 1 + test_regress/t/t_fork_write_after_timing.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index 8e8089f9a..6ac2855ed 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -389,6 +389,7 @@ class LinkParseVisitor final : public VNVisitor { // Variables in static tasks with timing control can be used after the task has ended // with use of join..fork_none, so they need to be static if (m_ftaskp->lifetime().isStatic() && m_hasTimingControl) { + nodep->v3warn(IMPLICITSTATIC, "Variable's lifetime implicitly set to static because in static task with timing control."); nodep->lifetime(VLifetime::STATIC_IMPLICIT); } else { nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT); diff --git a/test_regress/t/t_fork_write_after_timing.py b/test_regress/t/t_fork_write_after_timing.py index 7ded63f3a..f3eeea08e 100755 --- a/test_regress/t/t_fork_write_after_timing.py +++ b/test_regress/t/t_fork_write_after_timing.py @@ -11,7 +11,7 @@ import vltest_bootstrap test.scenarios('simulator') -test.compile(verilator_flags2=["--binary"]) +test.compile(verilator_flags2=["--binary", "-Wno-implicitstatic"]) test.execute()