From b06a32946669066bb672d43de6929c12352d158c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 18 Sep 2017 08:30:04 -0400 Subject: [PATCH] Fix GCC 4.4 false warning --- src/V3Broken.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/V3Broken.cpp b/src/V3Broken.cpp index 090b8d5fa..f73862c58 100644 --- a/src/V3Broken.cpp +++ b/src/V3Broken.cpp @@ -66,12 +66,16 @@ public: } if (iter!=s_nodes.end()) s_nodes.erase(iter); } +#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 4 + // GCC 4.4.* compiler warning bug, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39390 +# pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif static void addNewed(const AstNode* nodep) { // Called by operator new on any node - only if VL_LEAK_CHECKS if (debug()>=9) cout<<"-nodeNew: "<<(void*)(nodep)<second & FLAG_ALLOCATED)) { - ((AstNode*)(nodep))->v3fatalSrc("Newing AstNode object that is already allocated"); + nodep->v3fatalSrc("Newing AstNode object that is already allocated"); } if (iter == s_nodes.end()) { int flags = FLAG_ALLOCATED; // This int needed to appease GCC 4.1.2