From 5dbb150b07413818a9dd2335c7e93a334e7473a0 Mon Sep 17 00:00:00 2001 From: smith Date: Tue, 24 May 2022 17:49:33 +0800 Subject: [PATCH 1/2] Update defer.h avoid compile error: -Werror=non-virtual-dtor --- libgo/defer/defer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgo/defer/defer.h b/libgo/defer/defer.h index ad3dc4a2..7b85987b 100644 --- a/libgo/defer/defer.h +++ b/libgo/defer/defer.h @@ -7,7 +7,7 @@ namespace co struct dismisser { virtual bool dismiss() = 0; - + virtual ~dismisser() = default; static dismisser*& GetLastDefer(); static void SetLastDefer(dismisser*); static void ClearLastDefer(dismisser*); From b65455e3091f27db91406ff14715885382ab1db6 Mon Sep 17 00:00:00 2001 From: shichanghui Date: Mon, 25 Jul 2022 09:18:02 +0000 Subject: [PATCH 2/2] fix, solve complie on gcc-11, like issuse:https://github.com/apache/incubator-brpc/issues/1693 --- CMakeLists.txt | 2 +- libgo/coroutine.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index efcee3b6..9743c848 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ configure_file(${PROJECT_SOURCE_DIR}/libgo/common/cmake_config.h.in ${PROJECT_SO message("----------------------------------") if (UNIX) - set(CMAKE_CXX_FLAGS "-std=c++11 -D__const__= -fPIC -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "-std=c++11 -D__const__=__unused__ -fPIC -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -DNDEBUG") diff --git a/libgo/coroutine.h b/libgo/coroutine.h index 03a14d4d..f97d91cd 100644 --- a/libgo/coroutine.h +++ b/libgo/coroutine.h @@ -1,5 +1,9 @@ #pragma once -#define __const__ + +#ifndef __const__ +#define __const__ __unused__ +#endif + #include "common/config.h" #include "common/pp.h" #include "common/syntax_helper.h"