Re: allow benign typedef redefinitions (C11)
Álvaro Herrera <alvherre@kurilemu.de>
Attachments
- nobrintuple.patch (text/x-diff) patch
I happened to realize that brin_tuple.h (a somewhat nasty header which was only supposed to be used by BRIN itself and stuff like amcheck) recently somehow snuck into tuplesort.h with some nefarious consequences: that one has polluted execnodes.h, which means that header now depends on struct definitions that appear in genam.h. We should fix this. This patch is not the full solution, just a way to show the problem; for a definitive solution, IMO the definitions of structs IndexScanInstrumentation and SharedIndexScanInstrumentation should be elsewhere so that execnodes.h doesn't have to include genam.h. (gin_tuple.h is also there, but that one's much less of a problem.) Oh, and replication/conflict.h including all of execnodes.h is kind of ridiculous. Looks like that's easily solved with something like this though: diff --git a/src/include/pgstat.h b/src/include/pgstat.h index f402b17295c..7bcb4c68e18 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -11,6 +11,7 @@ #ifndef PGSTAT_H #define PGSTAT_H +#include "access/transam.h" #include "datatype/timestamp.h" #include "portability/instr_time.h" #include "postmaster/pgarch.h" /* for MAX_XFN_CHARS */ diff --git a/src/include/replication/conflict.h b/src/include/replication/conflict.h index e516caa5c73..e71b3c8f3d3 100644 --- a/src/include/replication/conflict.h +++ b/src/include/replication/conflict.h @@ -9,9 +9,14 @@ #ifndef CONFLICT_H #define CONFLICT_H -#include "nodes/execnodes.h" +#include "access/xlogdefs.h" +#include "nodes/pg_list.h" #include "utils/timestamp.h" +typedef struct EState EState; +typedef struct ResultRelInfo ResultRelInfo; +typedef struct TupleTableSlot TupleTableSlot; + /* * Conflict types that could occur while applying remote changes. * -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "La espina, desde que nace, ya pincha" (Proverbio africano)
Commits
-
Move instrumentation-related structs to instrument_node.h
- 2defd0006255 19 (unreleased) landed
-
Don't include access/htup_details.h in executor/tuptable.h
- 1a8b5b11e48a 19 (unreleased) landed
-
Don't include execnodes.h in brin.h or gin.h
- 1b6f61bd8988 19 (unreleased) landed
-
Do a tiny bit of header file maintenance
- 3bf31dd24314 19 (unreleased) landed
-
Don't include execnodes.h in replication/conflict.h
- 7e638d7f5093 19 (unreleased) landed
- 47da1745244b 18.1 landed
-
Update some more forward declarations to use typedef
- 81fc3e28e383 19 (unreleased) landed
-
Change fmgr.h typedefs to use original names
- 4bd91912987d 19 (unreleased) landed
-
Improve ExplainState type handling in header files
- 70407d39b7ea 19 (unreleased) landed
-
Remove hbaPort type
- dc41d7415fc6 19 (unreleased) landed
-
Remove workarounds against repeat typedefs
- 1e3b5edb8eb2 19 (unreleased) landed
-
Update various forward declarations to use typedef
- d4d1fc527bdb 19 (unreleased) landed
-
Allow redeclaration of typedef yyscan_t
- ae0e1be9f2a2 19 (unreleased) landed
-
Improve pgbench definition of yyscan_t
- 675ddc4d704f 19 (unreleased) landed
-
Delay extraction of TIDBitmap per page offsets
- bfe56cdf9a4e 18.0 cited
-
Remove pgrminclude and associated scripts
- 5af699066f81 18.0 cited
-
Allow to use HeapTupleData embedded in [Buffer]HeapTupleTableSlot.
- 5408e233f066 12.0 cited