v1-0001-Fix-erroneous-Werror-missing-braces-on-old-GCC.patch
text/x-patch
Filename: v1-0001-Fix-erroneous-Werror-missing-braces-on-old-GCC.patch
Type: text/x-patch
Part: 0
Patch
Format: format-patch
Series: patch v1-0001
Subject: Fix erroneous -Werror=missing-braces on old GCC
| File | + | − |
|---|---|---|
| src/bin/pgbench/pgbench.c | 6 | 1 |
From ecb342a88e5fb2a88f0086dcf46fdcadb6d930ba Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 9 Aug 2023 10:12:47 -0500
Subject: [PATCH v1] Fix erroneous -Werror=missing-braces on old GCC
The buildfarm reports that this is an error on gcc (Debian 4.7.2-5)
4.7.2, 32-bit. The bug seems to be GCC bug 53119, which has obviously
been fixed for years.
---
src/bin/pgbench/pgbench.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 2ba3e367c4..d2b7fc87e4 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -2239,10 +2239,15 @@ evalStandardFunc(CState *st,
{
/* evaluate all function arguments */
int nargs = 0;
- PgBenchValue vargs[MAX_FARGS] = { 0 };
PgBenchExprLink *l = args;
bool has_null = false;
+ /*
+ * This value is double braced to workaround GCC bug 53119, which seems to
+ * exist at least on gcc (Debian 4.7.2-5) 4.7.2, 32-bit.
+ */
+ PgBenchValue vargs[MAX_FARGS] = { { 0 } };
+
for (nargs = 0; nargs < MAX_FARGS && l != NULL; nargs++, l = l->next)
{
if (!evaluateExpr(st, l->expr, &vargs[nargs]))
--
Tristan Partin
Neon (https://neon.tech)