From 7e28d060871b19a8c09539e2da5e226b780431b9 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 7 Jun 2023 09:21:59 -0500 Subject: [PATCH v2] Fix last remaining uninitialized memory warnings gcc fails to properly analyze the code due to the loop stop condition including `l != NULL`. Let's just help it out. --- src/bin/pgbench/pgbench.c | 2 +- src/bin/pgbench/pgbench.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 539c2795e2..2ba3e367c4 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -2239,7 +2239,7 @@ evalStandardFunc(CState *st, { /* evaluate all function arguments */ int nargs = 0; - PgBenchValue vargs[MAX_FARGS]; + PgBenchValue vargs[MAX_FARGS] = { 0 }; PgBenchExprLink *l = args; bool has_null = false; diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h index 957c9ca9da..f8efa4b868 100644 --- a/src/bin/pgbench/pgbench.h +++ b/src/bin/pgbench/pgbench.h @@ -33,7 +33,7 @@ union YYSTYPE; */ typedef enum { - PGBT_NO_VALUE, + PGBT_NO_VALUE = 0, PGBT_NULL, PGBT_INT, PGBT_DOUBLE, -- Tristan Partin Neon (https://neon.tech)