From 4a8fef0d733965c1a1836022f8a42ab1e83a721f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 9 Aug 2023 10:00:50 +0200 Subject: [PATCH] Fix last remaining uninitialized memory warnings gcc (version 13) fails to properly analyze the code due to the loop stop condition including `l != NULL`. Let's just help it out. Author: Tristan Partin Discussion: https://www.postgresql.org/message-id/flat/CT6HJ3U8068R.3A8SJMV02D9BC@gonk --- 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,