Re: allow benign typedef redefinitions (C11)
Álvaro Herrera <alvherre@kurilemu.de>
Attachments
On 2025-Sep-28, Tom Lane wrote: > =?UTF-8?Q?=C3=81lvaro_Herrera?= <alvherre@kurilemu.de> writes: > > The changes to inet.h and varbit.h are surprising, but required. > > Why? Those headers compile now, and you've not removed any includes > that they might indirectly depend on. That's true. > If what you mean is that some of the macros in these headers require > varatt.h to be used, I do not agree that that means we should put > varatt.h into these headers. We've frequently relied on exactly > that property of macro definitions to avoid excessive or circular > inclusions. Moreover, even if we wanted to change that policy, > I know of no simple way to check it. We used to have a script called pgdefine that would create a .c file that would expand all macros defined in a header, and then ensure that the C file compiled. It was removed only recently (Dec. 2024), in commit 5af699066f81, though it's true that apparently nobody had used in a while. > I think what we're trying to do here is reduce the #includes of > header files to be just enough to compile the headers themselves. > That will bleed out into more #include's required in .c files, > but that's fine by me. Ok, that requires adding varatt.h to just two .c files -- attached. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
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