tests/paint-node: fix false-positive uninitialized variable

GCC 14.2 with debugoptimized build complained:

../../git/weston/tests/paint-node-test.c: In function ‘get_paint_node_status’:
../../git/weston/tests/paint-node-test.c:105:16: error: ‘changes’ may be used uninitialized [-Werror=maybe-uninitialized]
  105 |         return changes;
      |                ^~~~~~~
../../git/weston/tests/paint-node-test.c:87:39: note: ‘changes’ was declared here
   87 |         enum weston_paint_node_status changes;
      |                                       ^~~~~~~

The debug build did not complain.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2025-12-16 13:17:36 +02:00 committed by Marius Vlad
parent 66eaeb0c3f
commit 6af97ec150

View file

@ -84,7 +84,7 @@ static enum weston_paint_node_status
get_paint_node_status(struct client *client,
struct wet_testsuite_data *suite_data)
{
enum weston_paint_node_status changes;
enum weston_paint_node_status changes = WESTON_PAINT_NODE_CLEAN;
RUN_INSIDE_BREAKPOINT(client, suite_data) {
struct weston_compositor *compositor;