Fix compiler warning on typedef redeclaration
authorHeikki Linnakangas <[email protected]>
Fri, 23 Feb 2024 15:39:27 +0000 (17:39 +0200)
committerHeikki Linnakangas <[email protected]>
Fri, 23 Feb 2024 15:39:27 +0000 (17:39 +0200)
    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
src/include/storage/bulk_write.h

index 04a76ec5e36721b4395287f81054e0be0edfb520..4a10ece4c396b283de4826247a1f4e31acab681f 100644 (file)
@@ -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);
 
index 6d4532d05e18b7b0b3925af7eb5774938be71bbb..cf6f6fcb3f2868686149c8ba2b88c3f75d758fde 100644 (file)
@@ -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;
 
 /*