Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 89C7F133798E for ; Wed, 20 Apr 2011 19:13:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 66328-07 for ; Wed, 20 Apr 2011 22:13:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.121]) by mail.postgresql.org (Postfix) with ESMTP id 554E1133616B for ; Wed, 20 Apr 2011 19:13:29 -0300 (ADT) X-Authority-Analysis: v=1.1 cv=2vPzMgfOIErJN3e9oB0C+rg2PyH4jEtKOmutOqWodeY= c=1 sm=0 a=lpDWfFNTT9MA:10 a=Acs96HtBqXsA:10 a=8nJEP1OIZ-IA:10 a=qCTYjJJ2g1SgQhsHZAUATw==:17 a=KemSYLhRAAAA:8 a=VSY6Pc4VBUZ1ZHcnODMA:9 a=2CDncJXZ6k_0ow2wK1oA:7 a=wPNLvfGTeEIA:10 a=IvWp0zEv-XEA:10 a=3HBA6lb-PdYbt4sn:21 a=6w1KawMRNIZEYB_7:21 a=qCTYjJJ2g1SgQhsHZAUATw==:117 X-Cloudmark-Score: 0 X-Originating-IP: 98.27.48.207 Received: from [98.27.48.207] ([98.27.48.207:36507] helo=[192.168.10.146]) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 29/26-01460-98A5FAD4; Wed, 20 Apr 2011 22:13:30 +0000 Message-ID: <4DAF5A89.1070402@dunslane.net> Date: Wed, 20 Apr 2011 18:13:29 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.9 MIME-Version: 1.0 To: Tom Lane CC: Bruce Momjian , Robert Haas , pgsql-hackers@postgresql.org Subject: Re: pgindent weirdness References: <201104202028.p3KKSYX18339@momjian.us> <4DAF4AAF.9040709@dunslane.net> <18675.1303334960@sss.pgh.pa.us> In-Reply-To: <18675.1303334960@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201104/1107 X-Sequence-Number: 186309 On 04/20/2011 05:29 PM, Tom Lane wrote: > Andrew Dunstan 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