From f56f88710fd73ddef7457dbfd718b7dd31749073 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Fri, 31 Jul 2026 07:15:08 -0400 Subject: [PATCH] Initialize the flood fill's dirty rectangle at its declaration GCC cannot see that it is only read on a path where flood_region() wrote it, and warns under -Wmaybe-uninitialized. Co-Authored-By: Claude Opus 5 (1M context) --- src/draw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/draw.c b/src/draw.c index 95a4527..efc8fce 100644 --- a/src/draw.c +++ b/src/draw.c @@ -359,7 +359,9 @@ akerr_ErrorContext AKERR_NOIGNORE *akgl_draw_flood_fill(akgl_RenderBackend *self SDL_Surface *target = NULL; SDL_Surface *rgba = NULL; SDL_Texture *patch = NULL; - SDL_Rect dirty; + // Only written by a successful flood_region(), and only read after one, but + // the paths in between are far enough apart that the compiler cannot see it. + SDL_Rect dirty = { 0, 0, 0, 0 }; SDL_FRect src; SDL_FRect dest; uint32_t *pixels = NULL;