From 1af867a75006e5478b6f0410265aa958cb2d7bd1 Mon Sep 17 00:00:00 2001 From: sunsuodong Date: Mon, 25 Oct 2021 19:32:38 -0700 Subject: [PATCH] support high version gcc --- mindspore/core/CMakeLists.txt | 1 + mindspore/core/ir/dtype_extends.cc | 2 +- mindspore/lite/micro/coder/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mindspore/core/CMakeLists.txt b/mindspore/core/CMakeLists.txt index 9dcebb21a3b..1ad522bda9e 100644 --- a/mindspore/core/CMakeLists.txt +++ b/mindspore/core/CMakeLists.txt @@ -46,6 +46,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") endif() set_property(SOURCE ${CORE_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_CORE) +set_property(SOURCE ${PROTO_SRCS} PROPERTY COMPILE_OPTIONS -Wno-array-bounds) add_library(mindspore_core STATIC ${CORE_SRC_LIST} ${PROTO_SRCS}) target_link_libraries(mindspore_core PRIVATE mindspore_gvar) if(NOT(BUILD_LITE)) diff --git a/mindspore/core/ir/dtype_extends.cc b/mindspore/core/ir/dtype_extends.cc index 84b368c13a8..3806a03e43f 100644 --- a/mindspore/core/ir/dtype_extends.cc +++ b/mindspore/core/ir/dtype_extends.cc @@ -293,7 +293,7 @@ TypePtr GetTypeByFullString(const std::string &type_name) { TypePtr GetTypeByStringStarts(const std::string &type_name) { struct name_cmp { - bool operator()(const std::string &l, const std::string &r) { + bool operator()(const std::string &l, const std::string &r) const { auto cmp_len = std::min(l.length(), r.length()); return r.compare(0, cmp_len, l, 0, cmp_len) < 0; } diff --git a/mindspore/lite/micro/coder/CMakeLists.txt b/mindspore/lite/micro/coder/CMakeLists.txt index 79358279709..24542d1bf6a 100644 --- a/mindspore/lite/micro/coder/CMakeLists.txt +++ b/mindspore/lite/micro/coder/CMakeLists.txt @@ -28,6 +28,7 @@ endif() if(MSLITE_ENABLE_CONVERTER) include(${MICRO_DIR}/cmake/file_list.cmake) + set_property(SOURCE ${FILE_SET} PROPERTY COMPILE_OPTIONS -Wno-error=stringop-overflow=) add_executable(codegen main.cc ${FILE_SET}) add_dependencies(codegen fbs_src) add_dependencies(codegen fbs_inner_src)