From 141a2e36389795b3e6e9cae82c8639843446c4db Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 17 Jun 2024 16:55:36 +0200 Subject: [PATCH] Make C++17 compiler required --- .github/workflows/test-compile.yml | 4 ++-- Makefile | 4 ++-- kernel/yosys_common.h | 6 +----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 375ea7fc5..a892c91ce 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -64,11 +64,11 @@ jobs: $CXX --version # minimum standard - - name: Build C++11 + - name: Build C++17 shell: bash run: | make config-$CC_SHORT - make -j$procs CXXSTD=c++11 compile-only + make -j$procs CXXSTD=c++17 compile-only # maximum standard, only on newest compilers - name: Build C++20 diff --git a/Makefile b/Makefile index 7760cec43..73ea0bcc1 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ all: top-all YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST))) VPATH := $(YOSYS_SRC) -CXXSTD ?= c++11 +CXXSTD ?= c++17 CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include LIBS := $(LIBS) -lstdc++ -lm PLUGIN_LINKFLAGS := @@ -1015,7 +1015,7 @@ qtcreator: vcxsrc: $(GENFILES) $(EXTRA_TARGETS) rm -rf yosys-win32-vcxsrc-$(YOSYS_VER){,.zip} set -e; for f in `ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \ - echo "Analyse: $$f" >&2; cpp -std=c++11 -MM -I. -D_YOSYS_ $$f; done | sed 's,.*:,,; s,//*,/,g; s,/[^/]*/\.\./,/,g; y, \\,\n\n,;' | grep '^[^/]' | sort -u | grep -v kernel/version_ > srcfiles.txt + echo "Analyse: $$f" >&2; cpp -std=c++17 -MM -I. -D_YOSYS_ $$f; done | sed 's,.*:,,; s,//*,/,g; s,/[^/]*/\.\./,/,g; y, \\,\n\n,;' | grep '^[^/]' | sort -u | grep -v kernel/version_ > srcfiles.txt bash misc/create_vcxsrc.sh yosys-win32-vcxsrc $(YOSYS_VER) $(GIT_REV) echo "namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel/version.cc zip yosys-win32-vcxsrc-$(YOSYS_VER)/genfiles.zip $(GENFILES) kernel/version.cc diff --git a/kernel/yosys_common.h b/kernel/yosys_common.h index 9f1bc2f58..56d2356b1 100644 --- a/kernel/yosys_common.h +++ b/kernel/yosys_common.h @@ -142,12 +142,8 @@ extern Tcl_Obj *Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *p #if __cplusplus >= 201703L # define YS_FALLTHROUGH [[fallthrough]]; -#elif defined(__clang__) -# define YS_FALLTHROUGH [[clang::fallthrough]]; -#elif defined(__GNUC__) -# define YS_FALLTHROUGH [[gnu::fallthrough]]; #else -# define YS_FALLTHROUGH +# error "C++17 or later compatible compiler is required" #endif