The CompilerWarnings task on Cirrus CI does not catch warnings in C++ code. It tries to make warnings fatal by passing COPT='-Werror', but that does not apply to C++ compilations.

I suggest that we just add COPT to CXXFLAGS as well. I think passing -Werror is just about the only reasonable use of COPT nowadays, so making that more robust seems useful. I don't think there is a need for a separate make variable for C++ here.
From dbd1f09836e59fe163f72c4170d628f302bf5587 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Mon, 17 Jun 2024 10:33:19 +0200
Subject: [PATCH] Apply COPT to CXXFLAGS as well

The main use of that make variable is to pass in -Werror.  It makes
sense to apply this to C++ as well.
---
 src/Makefile.global.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 0a0ba0719f5..42f50b49761 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -742,6 +742,7 @@ endif
 #
 ifdef COPT
    CFLAGS += $(COPT)
+   CXXFLAGS += $(COPT)
    LDFLAGS += $(COPT)
 endif
 
-- 
2.45.2

Reply via email to