From 53cde90c8fcc01a0e5d264a7a6fe6f16aa9d64ff Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Mon, 18 May 2020 18:18:42 +0100 Subject: [PATCH] De-constify fields to appease old GCC with broken STL No functional change intended, fixes #2342 --- include/verilated_trace.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/verilated_trace.h b/include/verilated_trace.h index c905465ae..5dfb5f9fe 100644 --- a/include/verilated_trace.h +++ b/include/verilated_trace.h @@ -120,11 +120,15 @@ public: private: struct CallbackRecord { - const union { + // Note: would make these fields const, but some old STL implementations + // (the one in Ubuntu 14.04 with GCC 4.8.4 in particular) use the + // assignment operator on inserting into collections, so they don't work + // with const fields... + union { initCb_t m_initCb; // The callback function dumpCb_t m_dumpCb; // The callback function }; - void* const m_userp; // The user pointer to pass to the callback (the symbol table) + void* m_userp; // The user pointer to pass to the callback (the symbol table) CallbackRecord(initCb_t cb, void* userp) : m_initCb(cb) , m_userp(userp) {}