git/t/unit-tests
Collin Funk 4ac4705afa global: constify some pointers that are not written to
The recent glibc 2.43 release had the following change listed in its
NEWS file:

    For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
    strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
    pointers into their input arrays now have definitions as macros that
    return a pointer to a const-qualified type when the input argument is
    a pointer to a const-qualified type.

When compiling with GCC 15, which defaults to -std=gnu23, this causes
many warnings like this:

    merge-ort.c: In function ‘apply_directory_rename_modifications’:
    merge-ort.c:2734:36: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     2734 |                 char *last_slash = strrchr(cur_path, '/');
          |                                    ^~~~~~~

This patch fixes the more obvious ones by making them const when we do
not write to the returned pointer.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-05 17:52:49 -08:00
..
clar global: constify some pointers that are not written to 2026-02-05 17:52:49 -08:00
.gitignore
generate-clar-decls.sh
generate-clar-suites.sh
lib-oid.c
lib-oid.h
lib-reftable.c
lib-reftable.h
test-lib.c
test-lib.h
u-ctype.c
u-dir.c
u-example-decorate.c
u-hash.c
u-hashmap.c
u-mem-pool.c
u-oid-array.c
u-oidmap.c
u-oidtree.c
u-prio-queue.c
u-reftable-basics.c reftable: check for trailing newline in 'tables.list' 2025-10-07 09:22:57 -07:00
u-reftable-block.c
u-reftable-merged.c
u-reftable-pq.c
u-reftable-readwrite.c
u-reftable-record.c t/unit-tests: demonstrate use of integer comparison assertions 2025-12-07 07:25:16 +09:00
u-reftable-stack.c reftable/stack: add function to check if optimization is required 2025-11-10 09:28:47 -08:00
u-reftable-table.c
u-reftable-tree.c
u-strbuf.c
u-strcmp-offset.c
u-string-list.c
u-strvec.c
u-trailer.c
u-urlmatch-normalization.c
u-utf8-width.c builtin/repo: fix table alignment for UTF-8 characters 2025-11-16 16:04:24 -08:00
unit-test.c unit-test: ignore --no-chain-lint 2025-11-18 09:45:28 -08:00
unit-test.h t/unit-tests: update clar to 39f11fe 2025-12-07 07:25:15 +09:00