diff --git a/src/V3AstNodeDType.h b/src/V3AstNodeDType.h index 32f8f0c0a..da81bf75f 100644 --- a/src/V3AstNodeDType.h +++ b/src/V3AstNodeDType.h @@ -820,9 +820,9 @@ public: AstNodeDType* skipRefToEnump() const override { return (AstNodeDType*)this; } int widthAlignBytes() const override { return subDTypep()->widthAlignBytes(); } int widthTotalBytes() const override { return subDTypep()->widthTotalBytes(); } - int itemCount() const { + size_t itemCount() const { size_t count = 0; - for (AstNode* itemp = itemsp(); itemp; itemp = itemp->nextp()) count++; + for (AstNode* itemp = itemsp(); itemp; itemp = itemp->nextp()) ++count; return count; } bool isCompound() const override { return false; } diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 0611b2035..41df829fd 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -493,7 +493,7 @@ string V3Options::fileExists(const string& filename) { try { for (const auto& dirEntry : std::filesystem::directory_iterator(dir.c_str())) setp->insert(dirEntry.path().filename().string()); - } catch (std::filesystem::filesystem_error const& ex) { return ""; } + } catch (std::filesystem::filesystem_error const& ex) { (void)ex; return ""; } #else if (DIR* const dirp = opendir(dir.c_str())) { while (struct dirent* direntp = readdir(dirp)) setp->insert(direntp->d_name); diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index 69cedc7a5..0fa91741c 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -309,9 +309,9 @@ class RandomizeVisitor final : public VNVisitor { AstVar* enumValueTabp(AstEnumDType* nodep) { if (nodep->user2p()) return VN_AS(nodep->user2p(), Var); UINFO(9, "Construct Venumvaltab " << nodep << endl); - AstNodeArrayDType* const vardtypep - = new AstUnpackArrayDType{nodep->fileline(), nodep->dtypep(), - new AstRange{nodep->fileline(), nodep->itemCount(), 0}}; + AstNodeArrayDType* const vardtypep = new AstUnpackArrayDType{ + nodep->fileline(), nodep->dtypep(), + new AstRange{nodep->fileline(), static_cast(nodep->itemCount()), 0}}; AstInitArray* const initp = new AstInitArray{nodep->fileline(), vardtypep, nullptr}; v3Global.rootp()->typeTablep()->addTypesp(vardtypep); AstVar* const varp