From b60a92eed3eabd2d3a91cf133caa3e41775a0af4 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 30 May 2020 21:10:57 -0400 Subject: [PATCH] Fix pre-C11 compiler warning. --- include/verilatedos.h | 2 +- src/V3Gate.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/verilatedos.h b/include/verilatedos.h index 1730416c0..e3afdb903 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -149,7 +149,7 @@ // This is not necessarily the same as #UL, depending on what the IData typedef is. #define VL_UL(c) (static_cast(c##UL)) ///< Add appropriate suffix to 32-bit constant -#if defined(VL_CPPCHECK) || defined(__clang_analyzer__) +#if defined(VL_CPPCHECK) || defined(__clang_analyzer__) || __cplusplus < 201103L # define VL_DANGLING(var) #else ///< After e.g. delete, set variable to NULL to indicate must not use later diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index a974730cf..fe280677b 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -1549,7 +1549,7 @@ private: UINFO(9, " to - " << m_clk_vsp << endl); AstNode* rhsp = assignp->rhsp(); rhsp->replaceWith(new AstVarRef(rhsp->fileline(), m_clk_vsp, false)); - for (V3GraphEdge* edgep = lvertexp->inBeginp(); edgep;) { + while (V3GraphEdge* edgep = lvertexp->inBeginp()) { VL_DO_DANGLING(edgep->unlinkDelete(), edgep); } new V3GraphEdge(m_graphp, m_clk_vvertexp, lvertexp, 1);