pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Piotr Stefaniak <postgres@piotr-stefaniak.me>
Subject: Re: Preliminary results for proposed new pgindent implementation
Date: Fri, 19 May 2017 12:38:13 -0400
Message-ID: <2329.1495211893@sss.pgh.pa.us> (raw)
In-Reply-To: <aae20e71-5b34-cd3d-4661-5a7216589aab@iki.fi>
References: <30527.1495162840@sss.pgh.pa.us>
	<CA+TgmoamXhAoKY+pPSfGiu=3q6u-+1EOksdPimGS8YuqNuaSYQ@mail.gmail.com>
	<26654.1495203668@sss.pgh.pa.us>
	<20170519150526.GX3151@tamriel.snowman.net>
	<1b99bd34-04f1-cc33-1cfa-70501e92c008@iki.fi>
	<31921.1495208934@sss.pgh.pa.us>
	<aae20e71-5b34-cd3d-4661-5a7216589aab@iki.fi>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Heikki Linnakangas <hlinnaka@iki.fi> writes:
> On 05/19/2017 06:48 PM, Tom Lane wrote:
>> That's going to catch a lot of things that are just variables, though.
>> It might be all right as long as there was manual filtering after it.

> At a quick glance, there are only a couple of them. This two cases 
> caught my eye. In twophase.c:

> static struct xllist
> {
> ...
> }       records;

> IMHO it would actually be an improvement if there was a space rather 
> than a tab there.

Agreed, but if "records" were considered a typedef name, that would
likely screw up the formatting of code referencing it.  Maybe less
badly with this version of indent than our old one, not sure.

What I was just looking at is the possibility of absorbing struct
tags ("xllist" in the above) as if they were typedef names.  In
at least 95% of our usages, if a struct has a tag then the tag is
also the struct's typedef name.  The reason this is interesting
is that it looks like (on at least Linux and macOS) the debug info
captures struct tags even when it misses the corresponding typedef.
We could certainly create a coding rule that struct tags *must*
match struct typedef names for our own code, but I'm not sure what
violations of that convention might appear in system headers.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (50+ messages)  latest in thread

Message-ID: <2329.1495211893@sss.pgh.pa.us>
Permalink:  ../2329.1495211893@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2329.1495211893@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hlinnaka@iki.fi, sfrost@snowman.net, robertmhaas@gmail.com, postgres@piotr-stefaniak.me
  Subject: Re: Preliminary results for proposed new pgindent implementation
  In-Reply-To: <2329.1495211893@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox