postgres.git / summary / log / commit / refs

commit    4a8fef0d733965c1a1836022f8a42ab1e83a721f
Author:   Peter Eisentraut <peter@eisentraut.org>
Date:     Wed Aug 09 08:00:50 2023 +0000
First released in: 17.0

    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 <tristan@neon.tech>
    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 539c2795e29..2ba3e367c48 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 957c9ca9dad..f8efa4b868a 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, [parent: a72d613b4c91]