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.


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

Reply via email to