Skip to content

Commit

Permalink
Fix last remaining uninitialized memory warnings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
petere committed Aug 9, 2023
1 parent a72d613 commit 4a8fef0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bin/pgbench/pgbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/bin/pgbench/pgbench.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ union YYSTYPE;
*/
typedef enum
{
PGBT_NO_VALUE,
PGBT_NO_VALUE = 0,
PGBT_NULL,
PGBT_INT,
PGBT_DOUBLE,
Expand Down

0 comments on commit 4a8fef0

Please sign in to comment.