Skip to content

Commit 3a7e783

Browse files
Denton-Lgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb883b0 commit 3a7e783

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/unit-tests/clar/clar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static void
350350
clar_run_suite(const struct clar_suite *suite, const char *filter)
351351
{
352352
const struct clar_func *test = suite->tests;
353-
size_t i, matchlen;
353+
size_t i, matchlen = 0;
354354
struct clar_report *report;
355355
int exact = 0;
356356

0 commit comments

Comments
 (0)