Re: Run pgindent now?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Run pgindent now?
Date: 2015-05-27 21:08:56
Message-ID: 20150527210856.GO5310@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-05-27 16:55:45 -0400, Peter Eisentraut wrote:
> On 5/26/15 8:31 PM, Andres Freund wrote:
> > I actually think both are relatively easy to figure out without a
> > typedef list. There's harder cases though, e.g. (char *) &foo in an
> > expression is already more complicated.
>
> Well, if you know of a way to fix this, let's see it. Others have been
> trying for 20+ years.

I don't think I need to. clang-format has apparently done pretty much
what I described:

typedef struct foo {int a} foo;
struct bar;

int frak(struct bar * barstar, foo * foostar, unknown * unknown)
{
struct bar * barstar2;
foo * foostar2;
int * intstar2;
unknown * unknown2;

pointless * operation;
a = foostart * barstar2;
x = (frak *) & blub;
}
=>
typedef struct foo
{
int a
} foo;
struct bar;

int
frak(struct bar *barstar, foo *foostar, unknown *unknown)
{
struct bar *barstar2;
foo *foostar2;
int *intstar2;
unknown *unknown2;

pointless *operation;
a = foostart * barstar2;
x = (frak *) &blub;
}

Yes, it gets pointless * operation wrong. But boohoo.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2015-05-27 21:19:33 Re: Run pgindent now?
Previous Message Peter Eisentraut 2015-05-27 20:55:45 Re: Run pgindent now?