From ea82bfccede046a383595dbafbab3a43c07d405f Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 6 Jul 2017 19:07:23 -0400 Subject: [PATCH] Fix GCC 6 warnings. --- Changes | 2 ++ bin/verilator | 2 +- src/V3Ast.h | 3 ++- src/V3Cdc.cpp | 4 ++-- src/Verilator.cpp | 2 +- test_regress/driver.pl | 1 + 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index d0f5a018f..1cd82cbe9 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,8 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Support x in $readmem, bug1180. [Arthur Kahlich] +**** Fix GCC 6 warnings. + * Verilator 3.906 2017-06-22 diff --git a/bin/verilator b/bin/verilator index 211c109bd..ac027c8f7 100755 --- a/bin/verilator +++ b/bin/verilator @@ -1510,7 +1510,7 @@ OPT, OPT_FAST, or OPT_SLOW lib/verilated.mk. Or, use the -CFLAGS and/or the compiler or linker. Or, just for one run, pass them on the command line to make: - make OPT_FAST="-O2" -f Vour.mk Vour__ALL.a + make OPT_FAST="-O2 -fno-stack-protector" -f Vour.mk Vour__ALL.a OPT_FAST specifies optimizations for those programs that are part of the fast path, mostly code that is executed every cycle. OPT_SLOW specifies diff --git a/src/V3Ast.h b/src/V3Ast.h index ad4f2c6c0..e20919a53 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -903,7 +903,8 @@ class V3Hash { uint32_t m_both; static const uint32_t M24 = ((1<<24)-1); void setBoth(uint32_t depth, uint32_t hshval) { - if (depth==0) depth=1; if (depth>255) depth=255; + if (depth==0) depth=1; + if (depth>255) depth=255; m_both = (depth<<24) | (hshval & M24); } public: diff --git a/src/V3Cdc.cpp b/src/V3Cdc.cpp index 27af06266..76f776a9b 100644 --- a/src/V3Cdc.cpp +++ b/src/V3Cdc.cpp @@ -591,14 +591,14 @@ private: vertexp->dstDomainp(senoutp); if (debug()>=9) { UINFO(9,spaces(level)+" Tracedst "<srcDomainSet(true); // Note it's set - domainp may be null, so can't use that vertexp->srcDomainp(senoutp); if (debug()>=9) { UINFO(9,spaces(level)+" Tracesrc "<checkTree(); } void V3Global::clear() { - if (m_rootp) m_rootp->deleteTree(); m_rootp=NULL; + if (m_rootp) { m_rootp->deleteTree(); m_rootp=NULL; } } void V3Global::readFiles() { diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 454a6e6f7..10a02f383 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -18,6 +18,7 @@ use Data::Dumper; $Data::Dumper::Sortkeys=1; use strict; use vars qw ($Debug %Vars $Driver $Fork); use POSIX qw(strftime); +use lib "."; $::Driver = 1; $::Have_Forker = 0;