diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index be2b53f8e81df6..545484a004e30e 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -321,9 +321,8 @@ if (COMPILER_CLANG) -Wconversion) add_compile_options( -Wno-gnu-statement-expression -Wno-implicit-float-conversion - -Wno-implicit-int-conversion -Wno-sign-conversion - -Wno-shorten-64-to-32) + ) if (USE_LIBCPP) add_compile_options($<$:-stdlib=libc++>) add_definitions(-DUSE_LIBCPP) @@ -722,6 +721,12 @@ if (MAKE_TEST) if (ARCH_ARM) add_compile_options(-ffp-contract=off) endif() + if (COMPILER_CLANG) + add_compile_options( + -Wno-implicit-int-conversion + -Wno-shorten-64-to-32 + ) + endif() endif () # use this to avoid some runtime tracker. reuse BE_TEST symbol, no need another. diff --git a/be/src/cloud/cloud_internal_service.cpp b/be/src/cloud/cloud_internal_service.cpp index d8a5910eb0f17f..59a198ee1710c9 100644 --- a/be/src/cloud/cloud_internal_service.cpp +++ b/be/src/cloud/cloud_internal_service.cpp @@ -28,6 +28,7 @@ #include "io/cache/block_file_cache_factory.h" namespace doris { +#include "common/compile_check_avoid_begin.h" #include "common/compile_check_begin.h" CloudInternalServiceImpl::CloudInternalServiceImpl(CloudStorageEngine& engine, ExecEnv* exec_env) @@ -435,4 +436,5 @@ void CloudInternalServiceImpl::recycle_cache(google::protobuf::RpcController* co } } +#include "common/compile_check_avoid_end.h" } // namespace doris diff --git a/be/src/cloud/cloud_snapshot_loader.cpp b/be/src/cloud/cloud_snapshot_loader.cpp index 0fda0879fec5f6..b75616adf0c9e7 100644 --- a/be/src/cloud/cloud_snapshot_loader.cpp +++ b/be/src/cloud/cloud_snapshot_loader.cpp @@ -40,6 +40,7 @@ #include "util/slice.h" namespace doris { +#include "common/compile_check_avoid_begin.h" namespace { bool _end_with(std::string_view str, std::string_view match) { return str.size() >= match.size() && @@ -241,4 +242,5 @@ Status CloudSnapshotLoader::download(const std::map& s return status; } +#include "common/compile_check_avoid_end.h" } // end namespace doris diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index 6df4c8a6315fb3..003f0d86a22a76 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -47,6 +47,7 @@ #include "util/cpu_info.h" namespace doris::config { +#include "common/compile_check_avoid_begin.h" // Dir of custom config file DEFINE_String(custom_config_dir, "${DORIS_HOME}/conf"); @@ -2136,4 +2137,5 @@ std::vector> get_config_info() { return configs; } +#include "common/compile_check_avoid_end.h" } // namespace doris::config diff --git a/be/src/common/dwarf.cpp b/be/src/common/dwarf.cpp index 5402a992ff788b..ff9d9ff2382c35 100644 --- a/be/src/common/dwarf.cpp +++ b/be/src/common/dwarf.cpp @@ -152,6 +152,7 @@ #define DW_RLE_start_length 0x7 namespace doris { +#include "common/compile_check_avoid_begin.h" Dwarf::Dwarf(const std::shared_ptr& elf) : elf_(elf), @@ -2028,6 +2029,7 @@ bool Dwarf::LineNumberVM::findAddress(uintptr_t target, Path& file, uint64_t& li return false; } +#include "common/compile_check_avoid_end.h" } // namespace doris #endif diff --git a/be/src/common/logconfig.cpp b/be/src/common/logconfig.cpp index 05ccc5477d3ad3..73d4177a8de1e0 100644 --- a/be/src/common/logconfig.cpp +++ b/be/src/common/logconfig.cpp @@ -31,6 +31,7 @@ #include "common/logging.h" namespace doris { +#include "common/compile_check_avoid_begin.h" static bool logging_initialized = false; @@ -292,4 +293,5 @@ void update_logging(const std::string& name, const std::string& value) { } } +#include "common/compile_check_avoid_end.h" } // namespace doris diff --git a/be/src/gen_cpp/CMakeLists.txt b/be/src/gen_cpp/CMakeLists.txt index 437377f14652fa..e91b5e29c141b8 100644 --- a/be/src/gen_cpp/CMakeLists.txt +++ b/be/src/gen_cpp/CMakeLists.txt @@ -30,6 +30,13 @@ add_compile_options(-Wno-return-type) # each other add_library(DorisGen STATIC ${SRC_FILES}) +if (COMPILER_CLANG) + target_compile_options(DorisGen PRIVATE + -Wno-implicit-int-conversion + -Wno-shorten-64-to-32 + ) +endif() + # Setting these files as code-generated lets make clean and incremental builds work # correctly # set_source_files_properties(${SRC_FILES} PROPERTIES GENERATED TRUE) diff --git a/be/src/geo/geo_types.cpp b/be/src/geo/geo_types.cpp index 256f334e64f0f0..0f7376a58fa1d8 100644 --- a/be/src/geo/geo_types.cpp +++ b/be/src/geo/geo_types.cpp @@ -47,6 +47,7 @@ #include "geo/wkt_parse.h" namespace doris { +#include "common/compile_check_avoid_begin.h" constexpr double TOLERANCE = 1e-6; @@ -1627,4 +1628,5 @@ std::string GeoShape::as_binary(GeoShape* rhs) { return res; } +#include "common/compile_check_avoid_end.h" } // namespace doris diff --git a/be/src/geo/wkt_parse.cpp b/be/src/geo/wkt_parse.cpp index 5dd877833244ce..9f48f268fbc738 100644 --- a/be/src/geo/wkt_parse.cpp +++ b/be/src/geo/wkt_parse.cpp @@ -26,6 +26,7 @@ #include "geo/wkt_lex.l.h" namespace doris { +#include "common/compile_check_avoid_begin.h" GeoParseStatus WktParse::parse_wkt(const char* str, size_t len, GeoShape** shape) { WktParseContext ctx; @@ -46,4 +47,5 @@ GeoParseStatus WktParse::parse_wkt(const char* str, size_t len, GeoShape** shape return ctx.parse_status; } +#include "common/compile_check_avoid_end.h" } // namespace doris diff --git a/be/src/index-tools/CMakeLists.txt b/be/src/index-tools/CMakeLists.txt index c48b1a927e255e..2128c57548f4ea 100644 --- a/be/src/index-tools/CMakeLists.txt +++ b/be/src/index-tools/CMakeLists.txt @@ -35,6 +35,13 @@ target_link_libraries(index_tool ${DORIS_LINK_LIBS} ) +if (COMPILER_CLANG) + target_compile_options(index_tool PRIVATE + -Wno-implicit-int-conversion + -Wno-shorten-64-to-32 + ) +endif() + install(DIRECTORY DESTINATION ${OUTPUT_DIR}/lib/) install(TARGETS index_tool DESTINATION ${OUTPUT_DIR}/lib/) if (NOT OS_MACOSX) diff --git a/be/src/io/CMakeLists.txt b/be/src/io/CMakeLists.txt index dbd52e3560d47b..f80415e0caedd3 100644 --- a/be/src/io/CMakeLists.txt +++ b/be/src/io/CMakeLists.txt @@ -53,6 +53,13 @@ if (${BUILD_FS_BENCHMARK} STREQUAL "ON") benchmark ) + if (COMPILER_CLANG) + target_compile_options(fs_benchmark_tool PRIVATE + -Wno-implicit-int-conversion + -Wno-shorten-64-to-32 + ) + endif() + install(DIRECTORY DESTINATION ${OUTPUT_DIR}/lib/) install(TARGETS fs_benchmark_tool DESTINATION ${OUTPUT_DIR}/lib/) diff --git a/be/src/pipeline/exec/materialization_source_operator.cpp b/be/src/pipeline/exec/materialization_source_operator.cpp index 23d17c0167dff4..086659aabebc91 100644 --- a/be/src/pipeline/exec/materialization_source_operator.cpp +++ b/be/src/pipeline/exec/materialization_source_operator.cpp @@ -23,6 +23,7 @@ #include "vec/core/block.h" namespace doris::pipeline { +#include "common/compile_check_avoid_begin.h" Status MaterializationSourceOperatorX::get_block(RuntimeState* state, vectorized::Block* block, bool* eos) { @@ -67,4 +68,5 @@ Status MaterializationSourceOperatorX::get_block(RuntimeState* state, vectorized return Status::OK(); } +#include "common/compile_check_avoid_end.h" } // namespace doris::pipeline \ No newline at end of file diff --git a/be/src/tools/CMakeLists.txt b/be/src/tools/CMakeLists.txt index bc73713b2f2b4f..93e18980bb54a4 100644 --- a/be/src/tools/CMakeLists.txt +++ b/be/src/tools/CMakeLists.txt @@ -30,6 +30,14 @@ pch_reuse(meta_tool) # This permits libraries loaded by dlopen to link to the symbols in the program. set_target_properties(meta_tool PROPERTIES ENABLE_EXPORTS 1) + +if (COMPILER_CLANG) + target_compile_options(meta_tool PRIVATE + -Wno-implicit-int-conversion + -Wno-shorten-64-to-32 + ) +endif() + target_link_libraries(meta_tool ${DORIS_LINK_LIBS} ) diff --git a/be/src/util/cidr.cpp b/be/src/util/cidr.cpp index ec2a4aeb3cfbe7..4bab05e429e3e3 100644 --- a/be/src/util/cidr.cpp +++ b/be/src/util/cidr.cpp @@ -29,6 +29,7 @@ #include "common/logging.h" namespace doris { +#include "common/compile_check_avoid_begin.h" constexpr std::uint8_t kIPv4Bits = 32; constexpr std::uint8_t kIPv6Bits = 128; @@ -93,4 +94,5 @@ bool CIDR::contains(const CIDR& ip) const { return (_address[bytes] & mask) == (ip._address[bytes] & mask); } +#include "common/compile_check_avoid_end.h" } // end namespace doris diff --git a/be/src/util/cpu_info.cpp b/be/src/util/cpu_info.cpp index c5ed4562f640e9..2987d1dc099ce8 100644 --- a/be/src/util/cpu_info.cpp +++ b/be/src/util/cpu_info.cpp @@ -64,6 +64,7 @@ using boost::algorithm::contains; using boost::algorithm::trim; namespace fs = std::filesystem; +#include "common/compile_check_avoid_begin.h" using std::max; DECLARE_bool(abort_on_config_error); diff --git a/be/src/vec/exec/scan/olap_scanner.cpp b/be/src/vec/exec/scan/olap_scanner.cpp index ce33cf1d1c0065..9e65c55a8906ef 100644 --- a/be/src/vec/exec/scan/olap_scanner.cpp +++ b/be/src/vec/exec/scan/olap_scanner.cpp @@ -63,6 +63,7 @@ #include "vec/olap/block_reader.h" namespace doris::vectorized { +#include "common/compile_check_avoid_begin.h" using ReadSource = TabletReader::ReadSource; @@ -843,4 +844,5 @@ void OlapScanner::_collect_profile_before_close() { // Overhead counter removed; precise instrumentation is reported via engine_prepare above. } +#include "common/compile_check_avoid_end.h" } // namespace doris::vectorized diff --git a/be/src/vec/exec/skewed_partition_rebalancer.cpp b/be/src/vec/exec/skewed_partition_rebalancer.cpp index 233ff004522394..9549ccc9192780 100644 --- a/be/src/vec/exec/skewed_partition_rebalancer.cpp +++ b/be/src/vec/exec/skewed_partition_rebalancer.cpp @@ -24,6 +24,7 @@ #include namespace doris::vectorized { +#include "common/compile_check_avoid_begin.h" SkewedPartitionRebalancer::SkewedPartitionRebalancer( int partition_count, int task_count, int task_bucket_count, @@ -276,4 +277,5 @@ void SkewedPartitionRebalancer::_rebalance_partitions(long data_processed) { task_bucket_max_partitions); _data_processed_at_last_rebalance = data_processed; } +#include "common/compile_check_avoid_end.h" } // namespace doris::vectorized \ No newline at end of file