Re: Run pgindent now? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Run pgindent now?
Date
Msg-id 20150527210856.GO5310@alap3.anarazel.de
Whole thread Raw
In response to Re: Run pgindent now?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Run pgindent now?  (Peter Eisentraut <peter_e@gmx.net>)
List 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.



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Run pgindent now?
Next
From: Peter Eisentraut
Date:
Subject: Re: Run pgindent now?