git/compat
Johannes Schindelin 88c91d7d74 compat/regex: explicitly mark intentional use of the comma operator
The comma operator is a somewhat obscure C feature that is often used by
mistake and can even cause unintentional code flow. That is why the
`-Wcomma` option of clang was introduced: To identify unintentional uses
of the comma operator.

In the `compat/regex/` code, the comma operator is used twice, once to
avoid surrounding two conditional statements with curly brackets, the
other one to increment two counters simultaneously in a `do ... while`
condition.

The first one is replaced with a proper conditional block, surrounded by
curly brackets.

The second one would be harder to replace because the loop contains two
`continue`s. Therefore, the second one is marked as intentional by
casting the value-to-discard to `void`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-03-28 17:38:11 -07:00
..
fsmonitor global: trivial conversions to fix `-Wsign-compare` warnings 2024-12-06 20:20:04 +09:00
linux
…
nedmalloc compat: disable -Wunused-parameter in 3rd-party code 2024-08-28 09:51:18 -07:00
poll global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
regex compat/regex: explicitly mark intentional use of the comma operator 2025-03-28 17:38:11 -07:00
simple-ipc Merge branch 'ak/typofixes' 2024-10-25 14:02:04 -04:00
stub compat: mark unused parameters in win32/mingw functions 2024-08-28 09:51:18 -07:00
vcbuild mingw.c: Fix complier warnings for a 64 bit msvc 2024-10-17 14:42:27 -04:00
win32 compat/win32: fix -Wsign-compare warning in "wWinMain()" 2024-12-06 20:20:01 +09:00
.gitattributes
…
access.c
…
apple-common-crypto.h
…
basename.c compat/win32: fix const-correctness with string constants 2024-06-07 10:30:52 -07:00
bswap.h bswap.h: squelch potential sparse -Wcast-truncate warnings 2025-01-21 08:42:55 -08:00
compiler.h mingw.c: Fix complier warnings for a 64 bit msvc 2024-10-17 14:42:27 -04:00
disk.h compat: drop inclusion of <git-compat-util.h> 2024-02-24 14:37:41 -08:00
fileno.c
…
fopen.c
…
hstrerror.c
…
inet_ntop.c
…
inet_pton.c
…
memmem.c
…
mingw.c compat/mingw: rename the symlink, not the target 2025-02-21 10:24:43 -08:00
mingw.h compat: mark unused parameters in win32/mingw functions 2024-08-28 09:51:18 -07:00
mkdir.c
…
mkdtemp.c
…
mmap.c
…
msvc.c
…
msvc.h
…
nonblock.c
…
nonblock.h
…
obstack.c
…
obstack.h
…
open.c
…
pread.c
…
precompose_utf8.c path: drop `git_path_buf()` in favor of `repo_git_path_replace()` 2025-02-07 09:59:22 -08:00
precompose_utf8.h
…
qsort_s.c
…
regcomp_enhanced.c
…
setenv.c
…
sha1-chunked.c hash-ll: merge with "hash.h" 2024-06-14 10:26:33 -07:00
sha1-chunked.h
…
snprintf.c
…
stat.c
…
strcasestr.c
…
strdup.c
…
strlcpy.c
…
strtoimax.c
…
strtoumax.c
…
terminal.c global: trivial conversions to fix `-Wsign-compare` warnings 2024-12-06 20:20:04 +09:00
terminal.h
…
unsetenv.c
…
win32.h
…
win32mmap.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
winansi.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
zlib-compat.h compat/zlib: allow use of zlib-ng as backend 2025-01-28 13:03:23 -08:00