Skip to content

Commit 2fca5df

Browse files
committed
clang: warn when the comma operator is used
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 <johannes.schindelin@gmx.de>
1 parent 9a6de12 commit 2fca5df

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

config.mak.dev

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ DEVELOPER_CFLAGS += -Wvla
4040
DEVELOPER_CFLAGS += -Wwrite-strings
4141
DEVELOPER_CFLAGS += -fno-common
4242

43+
ifneq ($(filter clang9,$(COMPILER_FEATURES)),)
44+
DEVELOPER_CFLAGS += -Wcomma
45+
endif
46+
4347
ifneq ($(filter clang4,$(COMPILER_FEATURES)),)
4448
DEVELOPER_CFLAGS += -Wtautological-constant-out-of-range-compare
4549
endif

0 commit comments

Comments
 (0)