Andres Freund <and...@anarazel.de> writes: > On 2019-01-28 15:50:22 -0500, Tom Lane wrote: >> Andres Freund <and...@anarazel.de> writes: >>> Ugh, isn't it nicer to just use the underlying struct type instead of >>> that?
>> No, because that'd mean that anyplace relying on optimizer.h would also >> have to write "struct PlannerInfo" rather than "PlannerInfo"; the >> effects wouldn't be limited to the header itself. > Why? It can be called with the typedef'd version, or not. Because I don't want users of the header to have to declare, say, local variables as "struct PlannerInfo *root" instead of "PlannerInfo *root". The former is not project style and I will not accept forcing that in order to save a couple of #ifdefs in headers. I don't actually understand what you find so ugly about it. One idea that would save a lot of random "struct foo" hacks in headers is to allow nodes.h to include "typedef struct MyNode MyNode" for any recognized node type. We could either do that just for nodes we've found it useful for, or pre-emptively for the whole list. regards, tom lane