Re: allow benign typedef redefinitions (C11)

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-09-23T08:01:03Z
Lists: pgsql-hackers
On 19.09.25 12:52, Álvaro Herrera wrote:
> Here's a few more forward struct declarations turned into typedefs, for
> cleanliness sake.

Two comments; the rest looks okay to me.

* src/include/access/heapam.h

You are removing the declaration of struct TupleTableSlot and then go
on to use just TupleTableSlot; apparently that works, but that creates
an implicit dependency on typedef TupleTableSlot from somewhere else.
It might be better to change the existing struct TupleTableSlot
declaration into a typedef and keep it.

* src/include/nodes/execnodes.h

In this file, you are changing several times struct ScanKeyData to
just ScanKeyData, but there is no typedef of ScanKeyData in this file.
The struct ScanKeyData can exist by itself (it becomes declared as
soon as you use it), but the typedef needs to come from somewhere.  So
this change introduces a new dependency between this header and some
other header that provides that typedef.  I suggest you fix that by
adding a typedef in this file.




Commits

  1. Move instrumentation-related structs to instrument_node.h

  2. Don't include access/htup_details.h in executor/tuptable.h

  3. Don't include execnodes.h in brin.h or gin.h

  4. Do a tiny bit of header file maintenance

  5. Don't include execnodes.h in replication/conflict.h

  6. Update some more forward declarations to use typedef

  7. Change fmgr.h typedefs to use original names

  8. Improve ExplainState type handling in header files

  9. Remove hbaPort type

  10. Remove workarounds against repeat typedefs

  11. Update various forward declarations to use typedef

  12. Allow redeclaration of typedef yyscan_t

  13. Improve pgbench definition of yyscan_t

  14. Delay extraction of TIDBitmap per page offsets

  15. Remove pgrminclude and associated scripts

  16. Allow to use HeapTupleData embedded in [Buffer]HeapTupleTableSlot.