Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > OK, I have found the cause of the script error, and it was my fault. A
> > month after we ran pgindent for 8.3 (December 2007), I received this
> > issue from Tom:
>
> > http://archives.postgresql.org/pgsql-hackers/2007-12/msg00800.php
> >> Something I noticed the other day is that pgindent doesn't seem to treat
> >> "struct foo" or "union foo" as a type name, which is pretty silly
> >> because no context is needed at all to recognize that.
>
> Ah. So really the point here is that we want to specifically exclude
> "struct stat" because there are too many places in our code where "stat"
> is used as a regular identifier. Are there any other special cases like
> that?
Yep, lots. I see "option" also doing strange things, and some others.
You can see the diff here:
http://momjian.us/expire/pgindent/http://momjian.us/expire/pgindent/
Basically that list is meant for typedefs, not struct or union tags.
The BSD indent manual page says:
-Ttypename Adds typename to the list of type keywords. Names accu- mulate: -T can be
specifiedmore than once. You need to specify all the typenames that appear in your program
that are defined by typedef - nothing will be harmed if you miss a few, but the program
won'tbe formatted as nicely as it should. This sounds like a painful thing to
haveto do, but it's really a symptom of a problem in C: typedef causes a syntactic change in the
languageand indent can't find all instances of typedef.
I am unclear why struct pointers are not being formatted properly in
function headers but will research it.
-- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB
http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +