Internals: Fix remaining cppcheck errors (#6319)

Fixed the non const-related issue and added suppressions for the const
ones. With that `make cppcheck` should be clean.
This commit is contained in:
Geza Lore
2025-08-21 09:43:37 +01:00
committed by GitHub
parent bd91b619ad
commit 327d55d13d
64 changed files with 266 additions and 134 deletions
+2 -1
View File
@@ -99,7 +99,7 @@ class LinkLValueVisitor final : public VNVisitor {
{
m_setRefLvalue = VAccess::WRITE;
m_setContinuously = VN_IS(nodep, AssignW) || VN_IS(nodep, AssignAlias);
if (AstAssignW* assignwp = VN_CAST(nodep, AssignW)) {
if (const AstAssignW* const assignwp = VN_CAST(nodep, AssignW)) {
if (assignwp->strengthSpecp()) m_setStrengthSpecified = true;
}
{
@@ -250,6 +250,7 @@ class LinkLValueVisitor final : public VNVisitor {
iterateAndNextNull(nodep->rhsp());
iterateAndNextNull(nodep->thsp());
}
// cppcheck-suppress constParameterPointer
void prepost_visit(AstNodeTriop* nodep) {
VL_RESTORER(m_setRefLvalue);
m_setRefLvalue = VAccess::NOCHANGE;