From: Johannes Schindelin via GitGitGadget Date: Tue, 25 Mar 2025 23:32:13 GMT Subject: [PATCH v2 09/10] clang: warn when the comma operator is used Message-ID: <91f86c3aba9d19d5df11661675fd6c2cc049e191.1742945534.git.gitgitgadget@gmail.com> In-Reply-To: From: Johannes Schindelin When compiling Git using `clang`, the `-Wcomma` option can be used to warn about code using the comma operator (because it is typically unintentional and wants to use the semicolon instead). Signed-off-by: Johannes Schindelin --- config.mak.dev | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.mak.dev b/config.mak.dev index 0fd8cc4d355..31423638169 100644 --- a/config.mak.dev +++ b/config.mak.dev @@ -40,6 +40,10 @@ DEVELOPER_CFLAGS += -Wvla DEVELOPER_CFLAGS += -Wwrite-strings DEVELOPER_CFLAGS += -fno-common +ifneq ($(filter clang9,$(COMPILER_FEATURES)),) +DEVELOPER_CFLAGS += -Wcomma +endif + ifneq ($(filter clang4,$(COMPILER_FEATURES)),) DEVELOPER_CFLAGS += -Wtautological-constant-out-of-range-compare endif -- gitgitgadget