This is an automated email from the ASF dual-hosted git repository.
maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/main by this push:
new e7e07c27a7d Fix compile issue for higher version of gcc/g++
e7e07c27a7d is described below
commit e7e07c27a7d874fc3678f0aa08e5e29ab7f730ce
Author: Hao Wu <[email protected]>
AuthorDate: Mon Nov 10 14:40:45 2025 +0000
Fix compile issue for higher version of gcc/g++
1. return std::move(temp_value) will report error in high version of g++,
keep the behavior align with higher version of g++.
2. remove some maybe uninitialized varible.
3. add -Wno-error=array-bounds, so protobuf header will not report errors.
---
contrib/pax_storage/CMakeLists.txt | 2 +-
contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc | 4 ++--
contrib/pax_storage/src/cpp/storage/micro_partition_stats.cc | 2 --
contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc | 2 +-
4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/contrib/pax_storage/CMakeLists.txt
b/contrib/pax_storage/CMakeLists.txt
index 29c3a347dd8..5942f3bd913 100644
--- a/contrib/pax_storage/CMakeLists.txt
+++ b/contrib/pax_storage/CMakeLists.txt
@@ -21,7 +21,7 @@ set(CMAKE_CXX_STANDARD 17)
set(TOP_DIR ${PROJECT_SOURCE_DIR}/../..)
set(CBDB_INCLUDE_DIR ${TOP_DIR}/src/include)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror
-Wno-unused-function -Wno-error=ignored-qualifiers -Wuninitialized -Winit-self
-Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-parameter
-Wno-clobbered -Wno-sized-deallocation -g")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror
-Werror=pessimizing-move -Wno-unused-function -Wno-error=ignored-qualifiers
-Wno-error=array-bounds -Wuninitialized -Winit-self -Wstrict-aliasing
-Wno-missing-field-initializers -Wno-unused-parameter -Wno-clobbered
-Wno-sized-deallocation -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-parameter
-Wno-parameter-name")
option(USE_MANIFEST_API "Use manifest API" OFF)
diff --git a/contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc
b/contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc
index 9c9a1f8c8cd..bb9590ca5e9 100644
--- a/contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc
+++ b/contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc
@@ -164,7 +164,7 @@ MicroPartitionMetadata MicroPartitionInfoIterator::Next() {
Assert(tuple);
tuple_ = nullptr;
- return std::move(ToValue(tuple));
+ return ToValue(tuple);
}
void MicroPartitionInfoIterator::Rewind() {
@@ -375,7 +375,7 @@ MicroPartitionMetadata
MicroPartitionInfoParallelIterator::Next() {
Assert(tuple);
tuple_ = nullptr;
- return std::move(ToValue(tuple));
+ return ToValue(tuple);
}
void MicroPartitionInfoParallelIterator::Rewind() {
diff --git a/contrib/pax_storage/src/cpp/storage/micro_partition_stats.cc
b/contrib/pax_storage/src/cpp/storage/micro_partition_stats.cc
index b18ab952527..53342ad0e2a 100644
--- a/contrib/pax_storage/src/cpp/storage/micro_partition_stats.cc
+++ b/contrib/pax_storage/src/cpp/storage/micro_partition_stats.cc
@@ -173,7 +173,6 @@ static bool PrepareStatisticsInfoCombine(
auto attr = TupleDescAttr(desc, i);
auto collation = attr->attcollation;
- FmgrInfo finfo;
bool get_pg_oper_succ = false;
funcs.emplace_back(std::make_pair(nullptr, nullptr));
@@ -207,7 +206,6 @@ static bool PrepareStatisticsInfoCombine(
GetStrategyProcinfo(attr->atttypid, attr->atttypid, funcs[i]);
if (allow_fallback_to_pg) {
- finfos[i] = {finfo, finfo};
get_pg_oper_succ =
GetStrategyProcinfo(attr->atttypid, attr->atttypid, finfos[i]);
}
diff --git a/contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc
b/contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc
index f51bee8a07f..7da38f6ae06 100644
--- a/contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc
+++ b/contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc
@@ -331,7 +331,7 @@ static std::pair<Datum, std::shared_ptr<MemoryObject>>
pax_make_external_toast(
std::pair<Datum, std::shared_ptr<MemoryObject>> pax_make_toast(
Datum d, char storage_type) {
std::shared_ptr<MemoryObject> mobj;
- Datum result;
+ Datum result = d;
if (!pax_enable_toast) {
return {d, nullptr};
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]