[BugFix] fix clang-tidy errors on arm (#63447)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
This commit is contained in:
eyes_on_me 2025-09-29 09:54:08 +08:00 committed by GitHub
parent d4032438df
commit d597f92555
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View File

@ -650,6 +650,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Werror")
endif()
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unused-parameter -Wno-documentation -Wno-weak-vtables")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unknown-warning-option")
# Turn on following warning as error explicitly
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Werror=string-plus-int")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Werror=pessimizing-move")
@ -670,6 +671,10 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# ignore warning from apache-orc
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-switch-default")
endif ()
# Add -rtlib=compiler-rt for ARM architecture to fix LLVM bug: https://bugs.llvm.org/show_bug.cgi?id=16404
if ("${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "aarch64")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -rtlib=compiler-rt")
endif()
else ()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.0.0")
# ignore error from apache-orc

View File

@ -44,7 +44,7 @@ namespace starrocks {
\
virtual Expr* clone(ObjectPool* pool) const override { return pool->add(new CLASS_NAME(*this)); }
static std::optional<LogicalType> eliminate_trivial_cast_for_decimal_mul(const Expr* e) {
[[maybe_unused]] static std::optional<LogicalType> eliminate_trivial_cast_for_decimal_mul(const Expr* e) {
DIAGNOSTIC_PUSH
#if defined(__GNUC__) && !defined(__clang__)
DIAGNOSTIC_IGNORE("-Wmaybe-uninitialized")

View File

@ -168,9 +168,9 @@ template <LogicalType Type>
void BinaryPlainPageDecoder<Type>::batch_string_at_index(Slice* dst, const int32_t* idx, size_t size) const {
if (_parsed_datas.has_value()) {
const std::vector<Slice>& parsed_data = *_parsed_datas;
const Slice* parsed_data_ptr = parsed_data.data();
static_assert(sizeof(Slice) == sizeof(__int128));
#ifdef __SSE4_2__
const Slice* parsed_data_ptr = parsed_data.data();
#pragma GCC unroll 2
for (int i = 0; i < size; ++i) {
DCHECK_LT(idx[i], parsed_data.size());