Re: pgindent weirdness

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgindent weirdness
Date: 2011-04-20 22:13:29
Message-ID: 4DAF5A89.1070402@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/20/2011 05:29 PM, Tom Lane wrote:
> Andrew Dunstan<andrew(at)dunslane(dot)net> writes:
>> On 04/20/2011 04:28 PM, Bruce Momjian wrote:
>>> So the list of possible additions Andrew supplied are cases where we
>>> never reference those typedefs --- seems like a cleanup opportunity.
>> I think the best cleanup idea is Aidan's, namely is we have declared
>> "typdef struct foo { ... } foo;" we should use "foo" in the code
>> instead of "struct foo". Then the typedef will be referenced, and the
>> code will be cleaner, and we won't run into the pgindent "struct" bug
>> either, so it's a win/win/win.
> We want to do that in any case. I think that Bruce was suggesting going
> further and actively removing unreferenced struct tags from the
> declaration sites. I'm less enthused about that. It would save nothing
> except some probably-unmeasurable amount of compile time, and it'd
> result in a lot of diffs that might come back to bite future
> back-patching efforts.
>
>

Well he says not, but in any case I agree there's no great gain from it.
It's a well established C idiom, and as you pointed out upthread the
struct tag is just about required for defining recursive structs anyway.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-04-20 22:36:37 Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE
Previous Message Bruce Momjian 2011-04-20 21:43:11 Re: pgindent weirdness