Re: allow benign typedef redefinitions (C11)
Tom Lane <tgl@sss.pgh.pa.us>
=?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. > (It's possible that we should be including varatt.h in more datatype headers than just those two, but at least these are the ones that complained. So another option would be to include varatt.h in the files that include those headers. However, that seems to me to be the wrong direction). 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. Furthermore, this whole business of using "typedef struct foo foo;" to avoid including foo.h is predicated on the assumption that the ultimate consumer (some .c file) will itself include foo.h, because otherwise it's most likely gonna have problems with the incomplete typedef. So changing the rules about macros seems to me to be going in quite the wrong direction. 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. regards, tom lane
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