From 43213fcdc2020f80043e9027584b61accb8d8f1a Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 22 Aug 2020 07:43:56 -0400 Subject: [PATCH] Fix GCC warnings --- src/V3EmitC.cpp | 5 +++-- src/V3EmitV.cpp | 4 ++-- src/V3EmitXml.cpp | 4 ++-- src/V3SplitVar.cpp | 2 +- src/V3StatsReport.cpp | 2 +- src/V3Tristate.cpp | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 3bb4aa517..58372ebf2 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -1251,8 +1251,9 @@ private: public: // CONSTRUCTORS explicit EmitVarTspSorter(const MTaskIdSet& mtaskIds) - : m_mtaskIds{mtaskIds} - , m_serial(++m_serialNext) {} // Need () or GCC 4.8 false warning + : m_mtaskIds{mtaskIds} { + m_serial = ++m_serialNext; // Cannot be ()/{} or GCC 4.8 false warning + } virtual ~EmitVarTspSorter() {} // METHODS virtual bool operator<(const TspStateBase& other) const override { diff --git a/src/V3EmitV.cpp b/src/V3EmitV.cpp index 3edcf44c9..6ebfece29 100644 --- a/src/V3EmitV.cpp +++ b/src/V3EmitV.cpp @@ -704,7 +704,7 @@ class EmitVStreamVisitor : public EmitVBaseVisitor { public: EmitVStreamVisitor(AstNode* nodep, std::ostream& os) - : m_os{os} { + : m_os(os) { // Need () or GCC 4.8 false warning iterate(nodep); } virtual ~EmitVStreamVisitor() override {} @@ -743,7 +743,7 @@ public: int column() const { return m_column; } EmitVPrefixedFormatter(std::ostream& os, const string& prefix, int flWidth) : V3OutFormatter{"__STREAM", V3OutFormatter::LA_VERILOG} - , m_os{os} + , m_os(os) // Need () or GCC 4.8 false warning , m_prefix{prefix} , m_flWidth{flWidth} { m_column = 0; diff --git a/src/V3EmitXml.cpp b/src/V3EmitXml.cpp index 34b125bd8..b913eb755 100644 --- a/src/V3EmitXml.cpp +++ b/src/V3EmitXml.cpp @@ -288,7 +288,7 @@ private: public: // CONSTRUCTORS ModuleFilesXmlVisitor(AstNetlist* nodep, std::ostream& os) - : m_os{os} { + : m_os(os) { // Need () or GCC 4.8 false warning // Operate on whole netlist nodep->accept(*this); // Xml output @@ -360,7 +360,7 @@ private: public: // CONSTRUCTORS HierCellsXmlVisitor(AstNetlist* nodep, std::ostream& os) - : m_os{os} { + : m_os(os) { // Need () or GCC 4.8 false warning // Operate on whole netlist nodep->accept(*this); } diff --git a/src/V3SplitVar.cpp b/src/V3SplitVar.cpp index 71f54cb0b..5858fdc41 100644 --- a/src/V3SplitVar.cpp +++ b/src/V3SplitVar.cpp @@ -359,7 +359,7 @@ public: iterateChildren(nodep); } explicit Visitor(RefsInModule& p) - : m_parent{p} {} + : m_parent(p) {} // Need () or GCC 4.8 false warning } v(*this); v.iterate(nodep); } diff --git a/src/V3StatsReport.cpp b/src/V3StatsReport.cpp index fcbe55dd7..ae45f6f00 100644 --- a/src/V3StatsReport.cpp +++ b/src/V3StatsReport.cpp @@ -180,7 +180,7 @@ public: // CONSTRUCTORS explicit StatsReport(std::ofstream* aofp) - : os{*aofp} { + : os(*aofp) { // Need () or GCC 4.8 false warning header(); sumit(); stars(); diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index 84bb24574..a38bddc85 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -302,7 +302,7 @@ class TristatePinVisitor : public TristateBaseVisitor { public: // CONSTRUCTORS TristatePinVisitor(AstNode* nodep, TristateGraph& tgraph, bool lvalue) - : m_tgraph{tgraph} + : m_tgraph(tgraph) // Need () or GCC 4.8 false warning , m_lvalue{lvalue} { iterate(nodep); }