summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-03-20 11:25:58 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-03-20 11:25:58 +0100
commit618c64ffd3967cb5313b4b11e1e1043a074f2139 (patch)
tree70fdd05abd8db0553d0bd0bdb0d28bc0b151c213 /src/common
parentb7076c1e7f43f61515fa9a8c4f75e4329aef69ce (diff)
Revert workarounds for -Wmissing-braces false positives on old GCC
We have collected several instances of a workaround for GCC bug 53119, which caused false-positive compiler warnings. This bug has long been fixed, but was still seen on the buildfarm, most recently on lapwing with gcc (Debian 4.7.2-5). (The GCC bug tracker mentions that a fix was backported to 4.7.4 and 4.8.3.) That compiler no longer runs warning-free since commit 6fdd5d95634, so we don't need to keep these workarounds. And furthermore, the consensus appears to be that we don't want to keep supporting that era of platform anymore at all. This reverts the following commits: d937904cce6a3d82e4f9c2127de7b59105a134b3 506428d091760650971433f6bc083531c307b368 b449afb582bb9015bfbb85abc10ce122aef9ec70 6392f2a0968c20ecde4d27b6652703ad931fce92 bad0763a4d7be3005eae35d460c73ac4bc7ebaad 5e0c761d0a13c7b4f7c5de618ac38560d74d74d0 and makes a few similar fixes to newer code. Discussion: https://www.postgresql.org/message-id/flat/e170d61f-01ab-4cf9-ab68-91cd1fac62c5%40eisentraut.org Discussion: https://www.postgresql.org/message-id/flat/CA%2BTgmoYEAm-KKZibAP3hSqbTFTjUd47XtVcf3xSFDpyecXX9uQ%40mail.gmail.com
Diffstat (limited to 'src/common')
-rw-r--r--src/common/blkreftable.c12
-rw-r--r--src/common/file_utils.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/common/blkreftable.c b/src/common/blkreftable.c
index 6d9c1dfddbc..b935baf9ad4 100644
--- a/src/common/blkreftable.c
+++ b/src/common/blkreftable.c
@@ -265,7 +265,7 @@ BlockRefTableSetLimitBlock(BlockRefTable *brtab,
BlockNumber limit_block)
{
BlockRefTableEntry *brtentry;
- BlockRefTableKey key = {{0}}; /* make sure any padding is zero */
+ BlockRefTableKey key = {0}; /* make sure any padding is zero */
bool found;
memcpy(&key.rlocator, rlocator, sizeof(RelFileLocator));
@@ -300,7 +300,7 @@ BlockRefTableMarkBlockModified(BlockRefTable *brtab,
BlockNumber blknum)
{
BlockRefTableEntry *brtentry;
- BlockRefTableKey key = {{0}}; /* make sure any padding is zero */
+ BlockRefTableKey key = {0}; /* make sure any padding is zero */
bool found;
#ifndef FRONTEND
MemoryContext oldcontext = MemoryContextSwitchTo(brtab->mcxt);
@@ -340,7 +340,7 @@ BlockRefTableEntry *
BlockRefTableGetEntry(BlockRefTable *brtab, const RelFileLocator *rlocator,
ForkNumber forknum, BlockNumber *limit_block)
{
- BlockRefTableKey key = {{0}}; /* make sure any padding is zero */
+ BlockRefTableKey key = {0}; /* make sure any padding is zero */
BlockRefTableEntry *entry;
Assert(limit_block != NULL);
@@ -521,7 +521,7 @@ WriteBlockRefTable(BlockRefTable *brtab,
for (i = 0; i < brtab->hash->members; ++i)
{
BlockRefTableSerializedEntry *sentry = &sdata[i];
- BlockRefTableKey key = {{0}}; /* make sure any padding is zero */
+ BlockRefTableKey key = {0}; /* make sure any padding is zero */
unsigned j;
/* Write the serialized entry itself. */
@@ -616,7 +616,7 @@ BlockRefTableReaderNextRelation(BlockRefTableReader *reader,
BlockNumber *limit_block)
{
BlockRefTableSerializedEntry sentry;
- BlockRefTableSerializedEntry zentry = {{0}};
+ BlockRefTableSerializedEntry zentry = {0};
/*
* Sanity check: caller must read all blocks from all chunks before moving
@@ -1291,7 +1291,7 @@ BlockRefTableWrite(BlockRefTableBuffer *buffer, void *data, int length)
static void
BlockRefTableFileTerminate(BlockRefTableBuffer *buffer)
{
- BlockRefTableSerializedEntry zentry = {{0}};
+ BlockRefTableSerializedEntry zentry = {0};
pg_crc32c crc;
/* Write a sentinel indicating that there are no more entries. */
diff --git a/src/common/file_utils.c b/src/common/file_utils.c
index 0e3cfede935..eaa2e76f43f 100644
--- a/src/common/file_utils.c
+++ b/src/common/file_utils.c
@@ -687,7 +687,7 @@ pg_pwritev_with_retry(int fd, const struct iovec *iov, int iovcnt, off_t offset)
ssize_t
pg_pwrite_zeros(int fd, size_t size, off_t offset)
{
- static const PGIOAlignedBlock zbuffer = {{0}}; /* worth BLCKSZ */
+ static const PGIOAlignedBlock zbuffer = {0}; /* worth BLCKSZ */
void *zerobuf_addr = unconstify(PGIOAlignedBlock *, &zbuffer)->data;
struct iovec iov[PG_IOV_MAX];
size_t remaining_size = size;