From: Denton Liu Date: Tue, 5 Aug 2025 05:31:16 +0000 (-0700) Subject: t/unit-tests/clar: fix -Wmaybe-uninitialized with -Og X-Git-Tag: v2.51.0-rc1~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a7e783d9c5334cc5ea1af74b42297560ce697ce;p=thirdparty%2Fgit.git t/unit-tests/clar: fix -Wmaybe-uninitialized with -Og When building with -Og on gcc 15.1.1, the build produces a warning. In practice, though, this cannot be hit because `exact` acts as a guard and that variable can only be set after `matchlen` is already initialized Assign a default value to `matchlen` so that the warning is silenced. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- diff --git a/t/unit-tests/clar/clar.c b/t/unit-tests/clar/clar.c index d54e455367..03a3aa8e87 100644 --- a/t/unit-tests/clar/clar.c +++ b/t/unit-tests/clar/clar.c @@ -350,7 +350,7 @@ static void clar_run_suite(const struct clar_suite *suite, const char *filter) { const struct clar_func *test = suite->tests; - size_t i, matchlen; + size_t i, matchlen = 0; struct clar_report *report; int exact = 0;