Fix GCC warnings

This commit is contained in:
Wilson Snyder 2020-08-22 07:43:56 -04:00
parent f632ea500c
commit 43213fcdc2
6 changed files with 10 additions and 9 deletions

View File

@ -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 {

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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();

View File

@ -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);
}