Skip to content

Commit 4a8fef0

Browse files
committed
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
1 parent a72d613 commit 4a8fef0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bin/pgbench/pgbench.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,7 @@ evalStandardFunc(CState *st,
22392239
{
22402240
/* evaluate all function arguments */
22412241
int nargs = 0;
2242-
PgBenchValue vargs[MAX_FARGS];
2242+
PgBenchValue vargs[MAX_FARGS] = { 0 };
22432243
PgBenchExprLink *l = args;
22442244
bool has_null = false;
22452245

src/bin/pgbench/pgbench.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ union YYSTYPE;
3333
*/
3434
typedef enum
3535
{
36-
PGBT_NO_VALUE,
36+
PGBT_NO_VALUE = 0,
3737
PGBT_NULL,
3838
PGBT_INT,
3939
PGBT_DOUBLE,

0 commit comments

Comments
 (0)