From d360e3cc60e37d6d41ee78acf7bd5cb313b978c1 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 23 Feb 2024 17:39:27 +0200 Subject: [PATCH] Fix compiler warning on typedef redeclaration bulk_write.c:78:3: error: redefinition of typedef 'BulkWriteState' is a C11 feature [-Werror,-Wtypedef-redefinition] } BulkWriteState; ^ ../../../../src/include/storage/bulk_write.h:20:31: note: previous definition is here typedef struct BulkWriteState BulkWriteState; ^ 1 error generated. Per buildfarm animals 'sifaka' and 'longfin'. Discussion: https://www.postgresql.org/message-id/9e1f63c3-ef16-404c-b3cb-859a96eaba39@iki.fi --- src/backend/storage/smgr/bulk_write.c | 4 ++-- src/include/storage/bulk_write.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/storage/smgr/bulk_write.c b/src/backend/storage/smgr/bulk_write.c index 04a76ec5e36..4a10ece4c39 100644 --- a/src/backend/storage/smgr/bulk_write.c +++ b/src/backend/storage/smgr/bulk_write.c @@ -57,7 +57,7 @@ typedef struct PendingWrite /* * Bulk writer state for one relation fork. */ -typedef struct BulkWriteState +struct BulkWriteState { /* Information about the target relation we're writing */ SMgrRelation smgr; @@ -75,7 +75,7 @@ typedef struct BulkWriteState XLogRecPtr start_RedoRecPtr; MemoryContext memcxt; -} BulkWriteState; +}; static void smgr_bulk_flush(BulkWriteState *bulkstate); diff --git a/src/include/storage/bulk_write.h b/src/include/storage/bulk_write.h index 6d4532d05e1..cf6f6fcb3f2 100644 --- a/src/include/storage/bulk_write.h +++ b/src/include/storage/bulk_write.h @@ -17,6 +17,7 @@ #include "storage/smgr.h" #include "utils/rel.h" +/* Bulk writer state, contents are private to bulk_write.c */ typedef struct BulkWriteState BulkWriteState; /*