diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index 10e6fd09e6..90d487b1cb 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -495,7 +495,10 @@ if (COMPILER_GCC) message(FATAL_ERROR "Need GCC version at least 11.1") endif() - add_compile_options(-fdiagnostics-color=always) + add_compile_options(-fdiagnostics-color=always + -Wno-nonnull + -Wno-stringop-overread + -Wno-stringop-overflow) endif () if (COMPILER_CLANG) diff --git a/be/src/agent/task_worker_pool.cpp b/be/src/agent/task_worker_pool.cpp index d0d0f9b576..f85a5218b3 100644 --- a/be/src/agent/task_worker_pool.cpp +++ b/be/src/agent/task_worker_pool.cpp @@ -674,7 +674,7 @@ void TaskWorkerPool::_alter_tablet(const TAgentTaskRequest& agent_task_req, int6 // Check last schema change status, if failed delete tablet file // Do not need to adjust delete success or not // Because if delete failed create rollup will failed - TTabletId new_tablet_id; + TTabletId new_tablet_id = 0; TSchemaHash new_schema_hash = 0; if (status.ok()) { new_tablet_id = agent_task_req.alter_tablet_req_v2.new_tablet_id; diff --git a/be/src/glibc-compatibility/CMakeLists.txt b/be/src/glibc-compatibility/CMakeLists.txt index 2bc8602554..a29e712f4a 100644 --- a/be/src/glibc-compatibility/CMakeLists.txt +++ b/be/src/glibc-compatibility/CMakeLists.txt @@ -64,9 +64,21 @@ if (GLIBC_COMPATIBILITY) add_library(glibc-compatibility STATIC ${glibc_compatibility_sources}) if (COMPILER_CLANG) - target_compile_options(glibc-compatibility PRIVATE -Wno-unused-command-line-argument -Wno-unused-but-set-variable -Wno-unused-macros) + target_compile_options( + glibc-compatibility + PRIVATE + -Wno-unused-command-line-argument + -Wno-unused-but-set-variable + -Wno-unused-macros + ) elseif (COMPILER_GCC) - target_compile_options(glibc-compatibility PRIVATE -Wno-unused-but-set-variable -Wno-unused-but-set-variable -Wno-implicit-fallthrough) + target_compile_options( + glibc-compatibility + PRIVATE + -Wno-unused-but-set-variable + -Wno-implicit-fallthrough + -Wno-maybe-uninitialized + ) endif () target_include_directories(glibc-compatibility PRIVATE ${musl_arch_include_dir}) diff --git a/be/src/pipeline/pipeline_fragment_context.cpp b/be/src/pipeline/pipeline_fragment_context.cpp index 6b57cfd202..d3f0443863 100644 --- a/be/src/pipeline/pipeline_fragment_context.cpp +++ b/be/src/pipeline/pipeline_fragment_context.cpp @@ -278,18 +278,19 @@ Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& re #endif ) { auto* scan_node = static_cast(scan_nodes[i]); - const std::vector& scan_ranges = find_with_default( - local_params.per_node_scan_ranges, scan_node->id(), no_scan_ranges); + auto scan_ranges = find_with_default(local_params.per_node_scan_ranges, scan_node->id(), + no_scan_ranges); const bool shared_scan = find_with_default(local_params.per_node_shared_scans, scan_node->id(), false); scan_node->set_scan_ranges(scan_ranges); scan_node->set_shared_scan(_runtime_state.get(), shared_scan); } else { ScanNode* scan_node = static_cast(node); - const std::vector& scan_ranges = find_with_default( - local_params.per_node_scan_ranges, scan_node->id(), no_scan_ranges); + auto scan_ranges = find_with_default(local_params.per_node_scan_ranges, scan_node->id(), + no_scan_ranges); scan_node->set_scan_ranges(scan_ranges); - VLOG_CRITICAL << "scan_node_Id=" << scan_node->id() << " size=" << scan_ranges.size(); + VLOG_CRITICAL << "scan_node_Id=" << scan_node->id() + << " size=" << scan_ranges.get().size(); } } diff --git a/be/src/runtime/plan_fragment_executor.cpp b/be/src/runtime/plan_fragment_executor.cpp index 9b2f427b5f..2f0aaa444f 100644 --- a/be/src/runtime/plan_fragment_executor.cpp +++ b/be/src/runtime/plan_fragment_executor.cpp @@ -185,15 +185,16 @@ Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request, typeid(*node) == typeid(vectorized::NewJdbcScanNode) || typeid(*node) == typeid(vectorized::VMetaScanNode)) { vectorized::VScanNode* scan_node = static_cast(scan_nodes[i]); - const std::vector& scan_ranges = + auto scan_ranges = find_with_default(params.per_node_scan_ranges, scan_node->id(), no_scan_ranges); scan_node->set_scan_ranges(scan_ranges); } else { ScanNode* scan_node = static_cast(scan_nodes[i]); - const std::vector& scan_ranges = + auto scan_ranges = find_with_default(params.per_node_scan_ranges, scan_node->id(), no_scan_ranges); scan_node->set_scan_ranges(scan_ranges); - VLOG_CRITICAL << "scan_node_Id=" << scan_node->id() << " size=" << scan_ranges.size(); + VLOG_CRITICAL << "scan_node_Id=" << scan_node->id() + << " size=" << scan_ranges.get().size(); } } diff --git a/be/src/util/block_compression.cpp b/be/src/util/block_compression.cpp index f909d4c452..1857c526bc 100644 --- a/be/src/util/block_compression.cpp +++ b/be/src/util/block_compression.cpp @@ -229,7 +229,7 @@ public: private: Status _compress(const std::vector& inputs, size_t uncompressed_size, faststring* output) { - CContext* context; + CContext* context = nullptr; RETURN_IF_ERROR(_acquire_compression_ctx(&context)); bool compress_failed = false; Defer defer {[&] { diff --git a/be/src/util/container_util.hpp b/be/src/util/container_util.hpp index 3c99dc646d..1e26271772 100644 --- a/be/src/util/container_util.hpp +++ b/be/src/util/container_util.hpp @@ -75,7 +75,8 @@ V* find_or_insert(std::unordered_map* m, const K& key, const V& default_va // is not present, return the supplied default value template -const V& find_with_default(const std::map& m, const K& key, const V& default_val) { +std::reference_wrapper find_with_default(const std::map& m, const K& key, + const V& default_val) { typename std::map::const_iterator it = m.find(key); if (it == m.end()) { @@ -86,7 +87,8 @@ const V& find_with_default(const std::map& m, const K& key, const V& defau } template -const V& find_with_default(const std::unordered_map& m, const K& key, const V& default_val) { +std::reference_wrapper find_with_default(const std::unordered_map& m, const K& key, + const V& default_val) { typename std::unordered_map::const_iterator it = m.find(key); if (it == m.end()) { diff --git a/be/src/vec/exec/vaggregation_node.cpp b/be/src/vec/exec/vaggregation_node.cpp index 4c09e2b16c..3c6dd33483 100644 --- a/be/src/vec/exec/vaggregation_node.cpp +++ b/be/src/vec/exec/vaggregation_node.cpp @@ -930,8 +930,7 @@ Status AggregationNode::_reset_hash_table() { ((_total_size_of_aggregate_states + _align_aggregate_states - 1) / _align_aggregate_states) * _align_aggregate_states)); - HashTableType new_hash_table; - hash_table = std::move(new_hash_table); + hash_table = HashTableType(); _agg_arena_pool.reset(new Arena); return Status::OK(); }, diff --git a/be/src/vec/functions/function_json.cpp b/be/src/vec/functions/function_json.cpp index 9c256483c6..200ea3c237 100644 --- a/be/src/vec/functions/function_json.cpp +++ b/be/src/vec/functions/function_json.cpp @@ -679,6 +679,8 @@ struct FunctionJsonObjectImpl { template class FunctionJsonAlwaysNotNullable : public IFunction { public: + using IFunction::execute; + static constexpr auto name = SpecificImpl::name; static FunctionPtr create() { diff --git a/be/src/vec/functions/function_math_unary.h b/be/src/vec/functions/function_math_unary.h index 3db8016047..5f9fd7dd3b 100644 --- a/be/src/vec/functions/function_math_unary.h +++ b/be/src/vec/functions/function_math_unary.h @@ -33,6 +33,8 @@ namespace doris::vectorized { template class FunctionMathUnary : public IFunction { public: + using IFunction::execute; + static constexpr auto name = Impl::name; static constexpr bool has_variadic_argument = !std::is_void_v()))>; diff --git a/be/src/vec/functions/function_math_unary_to_null_type.h b/be/src/vec/functions/function_math_unary_to_null_type.h index 80386b35a9..dc9789f761 100644 --- a/be/src/vec/functions/function_math_unary_to_null_type.h +++ b/be/src/vec/functions/function_math_unary_to_null_type.h @@ -30,6 +30,8 @@ namespace doris::vectorized { template class FunctionMathUnaryToNullType : public IFunction { public: + using IFunction::execute; + static constexpr auto name = Impl::name; static FunctionPtr create() { return std::make_shared(); } @@ -122,4 +124,4 @@ private: } }; -} // namespace doris::vectorized \ No newline at end of file +} // namespace doris::vectorized diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index 2ad28cf9f7..f82f2735e5 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -147,6 +147,7 @@ if [[ "${CC}" == *gcc ]]; then warning_class_memaccess='-Wno-class-memaccess' warning_array_parameter='-Wno-array-parameter' warning_narrowing='-Wno-narrowing' + warning_dangling_reference='-Wno-dangling-reference' boost_toolset='gcc' elif [[ "${CC}" == *clang ]]; then warning_uninitialized='-Wno-uninitialized' @@ -828,7 +829,7 @@ build_rocksdb() { # -Wno-range-loop-construct gcc-11 CFLAGS="-I ${TP_INCLUDE_DIR} -I ${TP_INCLUDE_DIR}/snappy -I ${TP_INCLUDE_DIR}/lz4" \ - CXXFLAGS="-Wno-deprecated-copy ${warning_stringop_truncation} ${warning_shadow} ${warning_dangling_gsl} \ + CXXFLAGS="-include cstdint -Wno-deprecated-copy ${warning_stringop_truncation} ${warning_shadow} ${warning_dangling_gsl} \ ${warning_defaulted_function_deleted} ${warning_unused_but_set_variable} -Wno-pessimizing-move -Wno-range-loop-construct" \ LDFLAGS="${ldflags}" \ PORTABLE=1 make USE_RTTI=1 -j "${PARALLEL}" static_lib @@ -1247,7 +1248,8 @@ build_aws_sdk() { "${CMAKE_CMD}" -G "${GENERATOR}" -B"${BUILD_DIR}" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" \ -DCMAKE_PREFIX_PATH="${TP_INSTALL_DIR}" -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTING=OFF \ -DCURL_LIBRARY_RELEASE="${TP_INSTALL_DIR}/lib/libcurl.a" -DZLIB_LIBRARY_RELEASE="${TP_INSTALL_DIR}/lib/libz.a" \ - -DBUILD_ONLY="core;s3;s3-crt;transfer" -DCMAKE_CXX_FLAGS="-Wno-nonnull -Wno-deprecated-declarations" -DCPP_STANDARD=17 + -DBUILD_ONLY="core;s3;s3-crt;transfer" \ + -DCMAKE_CXX_FLAGS="-Wno-nonnull -Wno-deprecated-declarations ${warning_dangling_reference}" -DCPP_STANDARD=17 cd "${BUILD_DIR}" @@ -1394,6 +1396,7 @@ build_hdfs3() { -DKERBEROS_LIBRARIES="${TP_INSTALL_DIR}/lib/libkrb5.a" \ -DGSASL_INCLUDE_DIR="${TP_INSTALL_DIR}/include" \ -DGSASL_LIBRARIES="${TP_INSTALL_DIR}/lib/libgsasl.a" \ + -DCMAKE_CXX_FLAGS='-include cstdint' \ .. make CXXFLAGS="${libhdfs_cxx17}" -j "${PARALLEL}" diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh index 8919441efe..77f3439c41 100755 --- a/thirdparty/download-thirdparty.sh +++ b/thirdparty/download-thirdparty.sh @@ -400,3 +400,13 @@ if [[ "${SIMDJSON_SOURCE}" = "simdjson-3.0.1" ]]; then cd - fi echo "Finished patching ${SIMDJSON_SOURCE}" + +if [[ "${BRPC_SOURCE}" == 'brpc-1.4.0' ]]; then + cd "${TP_SOURCE_DIR}/${BRPC_SOURCE}" + if [[ ! -f "${PATCHED_MARK}" ]]; then + patch -p1 <"${TP_PATCH_DIR}/brpc-1.4.0-gcc13.patch" + touch "${PATCHED_MARK}" + fi + cd - +fi +echo "Finished patching ${BRPC_SOURCE}" diff --git a/thirdparty/patches/brpc-1.4.0-gcc13.patch b/thirdparty/patches/brpc-1.4.0-gcc13.patch new file mode 100644 index 0000000000..0cf7988d1d --- /dev/null +++ b/thirdparty/patches/brpc-1.4.0-gcc13.patch @@ -0,0 +1,12 @@ +diff --git a/src/brpc/http2.h b/src/brpc/http2.h +index 9a40d40..69d3087 100644 +--- a/src/brpc/http2.h ++++ b/src/brpc/http2.h +@@ -18,6 +18,7 @@ + #ifndef BAIDU_RPC_HTTP2_H + #define BAIDU_RPC_HTTP2_H + ++#include + #include "brpc/http_status_code.h" + + // To baidu-rpc developers: This is a header included by user, don't depend