Add missing CustomPathMethods on typedefs.list

Started by Matheus Alcantara18 days ago2 messageshackers
Jump to latest
#1Matheus Alcantara
matheusssilv97@gmail.com

Hi,

While reading src/include/nodes/extensible.h, I noticed that
CustomPathMethods was not correctly indented; this was because its
declaration was missing on typedefs.list. The attached patch fixes this.

--
Matheus Alcantara
EDB: https://www.enterprisedb.com

Attachments:

0001-Add-missing-CustomPathMethods-on-typedefs.list.patchtext/plain; charset=utf-8; name=0001-Add-missing-CustomPathMethods-on-typedefs.list.patchDownload+2-2
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Matheus Alcantara (#1)
Re: Add missing CustomPathMethods on typedefs.list

"Matheus Alcantara" <matheusssilv97@gmail.com> writes:

While reading src/include/nodes/extensible.h, I noticed that
CustomPathMethods was not correctly indented; this was because its
declaration was missing on typedefs.list. The attached patch fixes this.

In the end, typedefs.list is a mechanically generated file: the
authoritative list is whatever our buildfarm says it is. So trying
to force things is not helpful, because the change won't survive to
the end of the dev cycle.

The reason CustomPathMethods is not showing up in the generated list
is that it is not used anywhere to declare an object (variable, field,
function parameter or result, etc). The only place in core code that
has occasion to reference it is struct CustomPath, but that does

const struct CustomPathMethods *methods;

so it's not actually referencing the typedef. So a persistent fix
for this would have to do something about that. I think under C11
rules it'd be okay for pathnodes.h to duplicate the typedef
declaration:

typedef struct CustomPathMethods CustomPathMethods;
...
const CustomPathMethods *methods;

but I didn't try it.

regards, tom lane