From: Heikki Linnakangas Date: Fri, 23 Feb 2024 15:39:27 +0000 (+0200) Subject: Fix compiler warning on typedef redeclaration X-Git-Tag: REL_17_BETA1~826 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=d360e3cc60e37d6d41ee78acf7bd5cb313b978c1;p=postgresql.git 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 --- 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; /*