git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a72d613)
Fix last remaining uninitialized memory warnings
Wed, 9 Aug 2023 08:00:50 +0000 (10:00 +0200)
Wed, 9 Aug 2023 08:00:50 +0000 (10:00 +0200)
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


diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 539c2795e291ab0b73d37f2909923e469f082ce9..2ba3e367c482e92d67e924d5305486b097f1ab38 100644 (file)
--- 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 957c9ca9dad9bc29ba2f061e3dd925c19271f067..f8efa4b868a7531ef4ef5faece048cca62d943fd 100644 (file)
--- 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,
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /