This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new d4ca5f7d871 [env](compilation) open implicit-int-conversion check
(#55634)
d4ca5f7d871 is described below
commit d4ca5f7d871e556b7a892e2146214dd38c858f6c
Author: Mryange <[email protected]>
AuthorDate: Fri Sep 5 09:16:15 2025 +0800
[env](compilation) open implicit-int-conversion check (#55634)
---
be/CMakeLists.txt | 9 +++++++--
be/src/cloud/cloud_internal_service.cpp | 2 ++
be/src/cloud/cloud_snapshot_loader.cpp | 2 ++
be/src/common/config.cpp | 2 ++
be/src/common/dwarf.cpp | 2 ++
be/src/common/logconfig.cpp | 2 ++
be/src/gen_cpp/CMakeLists.txt | 7 +++++++
be/src/geo/geo_types.cpp | 2 ++
be/src/geo/wkt_parse.cpp | 2 ++
be/src/index-tools/CMakeLists.txt | 7 +++++++
be/src/io/CMakeLists.txt | 7 +++++++
be/src/pipeline/exec/materialization_source_operator.cpp | 2 ++
be/src/tools/CMakeLists.txt | 8 ++++++++
be/src/util/cidr.cpp | 2 ++
be/src/util/cpu_info.cpp | 1 +
be/src/vec/exec/scan/olap_scanner.cpp | 2 ++
be/src/vec/exec/skewed_partition_rebalancer.cpp | 2 ++
17 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index be2b53f8e81..545484a004e 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($<$<COMPILE_LANGUAGE:CXX>:-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 d8a5910eb0f..59a198ee171 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 0fda0879fec..b75616adf0c 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<std::string, std::string>& 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 442f8721a48..f4d71475e3a 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");
@@ -2125,4 +2126,5 @@ std::vector<std::vector<std::string>> 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 5402a992ff7..ff9d9ff2382 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_(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 05ccc5477d3..73d4177a8de 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 437377f1465..e91b5e29c14 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 256f334e64f..0f7376a58fa 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 5dd87783324..9f48f268fbc 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 c48b1a927e2..2128c57548f 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 dbd52e3560d..f80415e0cae 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 23d17c0167d..086659aabeb 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 bc73713b2f2..93e18980bb5 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 ec2a4aeb3cf..4bab05e429e 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 c5ed4562f64..2987d1dc099 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 ce33cf1d1c0..9e65c55a890 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 233ff004522..9549ccc9192 100644
--- a/be/src/vec/exec/skewed_partition_rebalancer.cpp
+++ b/be/src/vec/exec/skewed_partition_rebalancer.cpp
@@ -24,6 +24,7 @@
#include <list>
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]