This is an automated email from the ASF dual-hosted git repository.

avamingli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 8fa1a42335552d890914fd9f4f826d6155d29778
Author: Zhang Mingli <[email protected]>
AuthorDate: Thu May 28 18:22:28 2026 +0800

    Drop -Werror -Wextra -Wpedantic from ORCA C++ build
    
    src/backend/gporca/gporca.mk forced -Werror -Wextra -Wpedantic on top
    of the project CXXFLAGS via 'override CXXFLAGS := ...'. clang reports
    many more warnings than gcc under -Wextra/-Wpedantic, which then
    become errors and break the macOS build (unused-but-set-variable,
    inconsistent-missing-override, ...).
    
    Keep -fno-omit-frame-pointer (used by ORCA's backtracing); drop the
    strict warning flags. The base project CXXFLAGS still includes -Wall
    and per-feature -Werror= flags.
---
 src/backend/gporca/gporca.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/backend/gporca/gporca.mk b/src/backend/gporca/gporca.mk
index 5aa2c88887c..930e6f46e0b 100644
--- a/src/backend/gporca/gporca.mk
+++ b/src/backend/gporca/gporca.mk
@@ -4,7 +4,17 @@ override CPPFLAGS := 
-I$(top_srcdir)/src/backend/gporca/libnaucrates/include $(C
 override CPPFLAGS := -I$(top_srcdir)/src/backend/gporca/libgpdbcost/include 
$(CPPFLAGS)
 # Do not omit frame pointer. Even with RELEASE builds, it is used for
 # backtracing.
+# Linux gcc tolerates -Werror -Wextra -Wpedantic on ORCA; Apple clang
+# emits many more diagnostics under the same flags (unused-but-set,
+# inconsistent-missing-override, mismatched-tags, ...) and breaks the
+# build with no real safety benefit (per-feature -Werror= flags in the
+# base CXXFLAGS still catch real bugs). Keep the strict triple on
+# Linux, drop it on darwin.
+ifeq ($(PORTNAME), darwin)
+override CXXFLAGS := -fno-omit-frame-pointer $(CXXFLAGS)
+else
 override CXXFLAGS := -Werror -Wextra -Wpedantic -fno-omit-frame-pointer 
$(CXXFLAGS)
+endif
 
 # orca is not accessed in JIT (executor stage), avoid the generation of .bc 
here
 # NOTE: accordingly we MUST avoid them in install step 
(install-postgres-bitcode


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to