From b4851a6c7d07086dd170a8de8e963de88ebfcd30 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 11 Nov 2020 08:32:25 -0700 Subject: [PATCH] flex disable register decls --- CMakeLists.txt | 3 +++ liberty/LibertyExprLex.ll | 1 + liberty/LibertyLex.ll | 1 + parasitics/SpefLex.ll | 1 + sdf/SdfLex.ll | 1 + util/FlexDisableRegister.hh | 5 +++++ verilog/VerilogLex.ll | 1 + 7 files changed, 13 insertions(+) create mode 100644 util/FlexDisableRegister.hh diff --git a/CMakeLists.txt b/CMakeLists.txt index 25845d68..69243504 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,9 @@ set(STA_TCL_FILES # ################################################################ +# Earlier versions of flex use 'register' declarations are deprecated in c++11 +# and illegal in c++17. +#find_package(FLEX 2.6.4) find_package(FLEX) find_package(BISON) diff --git a/liberty/LibertyExprLex.ll b/liberty/LibertyExprLex.ll index 9388620d..ab588a24 100644 --- a/liberty/LibertyExprLex.ll +++ b/liberty/LibertyExprLex.ll @@ -18,6 +18,7 @@ // Liberty function expression lexical analyzer +#include "util/FlexDisableRegister.hh" #include "Debug.hh" #include "StringUtil.hh" #include "liberty/LibertyExprPvt.hh" diff --git a/liberty/LibertyLex.ll b/liberty/LibertyLex.ll index a2cc0373..092aafb7 100644 --- a/liberty/LibertyLex.ll +++ b/liberty/LibertyLex.ll @@ -18,6 +18,7 @@ #include #include +#include "util/FlexDisableRegister.hh" #include "liberty/LibertyParser.hh" #include "LibertyParse.hh" diff --git a/parasitics/SpefLex.ll b/parasitics/SpefLex.ll index 3c64a848..1bfbc115 100644 --- a/parasitics/SpefLex.ll +++ b/parasitics/SpefLex.ll @@ -19,6 +19,7 @@ #include #include +#include "util/FlexDisableRegister.hh" #include "StringUtil.hh" #include "parasitics/SpefReaderPvt.hh" #include "SpefParse.hh" diff --git a/sdf/SdfLex.ll b/sdf/SdfLex.ll index 14b9876a..e893af61 100644 --- a/sdf/SdfLex.ll +++ b/sdf/SdfLex.ll @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#include "util/FlexDisableRegister.hh" #include "sdf/Sdf.hh" #include "SdfParse.hh" diff --git a/util/FlexDisableRegister.hh b/util/FlexDisableRegister.hh new file mode 100644 index 00000000..bf90316a --- /dev/null +++ b/util/FlexDisableRegister.hh @@ -0,0 +1,5 @@ +// workaround for flex versions that insert register declarations +#if !(YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 6) && __cplusplus > 199711L +#define register +#endif + diff --git a/verilog/VerilogLex.ll b/verilog/VerilogLex.ll index 797feb2f..c1491a0d 100644 --- a/verilog/VerilogLex.ll +++ b/verilog/VerilogLex.ll @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#include "util/FlexDisableRegister.hh" #include "Debug.hh" #include "VerilogNamespace.hh" #include "verilog/VerilogReaderPvt.hh"