Re: pg_bsd_indent - improvements around offsetof and sizeof

From: Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_bsd_indent - improvements around offsetof and sizeof
Date: 2016-05-27 06:13:48
Message-ID: BLU436-SMTP4660B074E6A8F11E76B6BAF2420@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016-05-25 21:13, Tom Lane wrote:
> Assuming this patch withstands more careful review, we will need to think
> about project policy for how/when to apply such fixes.

I discovered yesterday that Bruce Evans had done the fix for sizeof in
their fork of indent(1) in 2004 (r125623 [1]). The core fix is exactly
the same as mine, he just did more fixes around it, which I haven't
analyzed.

I'm trying to see if FreeBSD indent can successfully do pg_bsd_indent's
job. So far I had to fix one thing, which is not adding a space after a
cast operator, for which they added no option to turn it off. Currently
I'm fighting one other bug, but I think that'll be it.

I took interest in FreeBSD's fork of indent(1) because they've fixed
more things than NetBSD people have in their fork, it seems. I'm also
hoping it'll be easier to reinvent GNU indent's -tsn ("set tabsize to n
spaces") option for FreeBSD indent than it would be for any other of the
forks that aren't GNU. I envision that to be the first step to getting
rid of some of the work-arounds pgindent does, mainly running entab and
detab as pre- and post-processing steps.

If porting FreeBSD indent to PostgreSQL's sources turns out to be
successful, there will be a choice between rebasing pg_bsd_indent on
that and picking specific patches and applying it on PG's fork of indent(1).

[1]
https://svnweb.freebsd.org/base/head/usr.bin/indent/lexi.c?r1=125619&r2=125623

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2016-05-27 07:07:03 Re: PATCH: pg_restore parallel-execution-deadlock issue
Previous Message Andres Freund 2016-05-27 04:37:12 Re: Perf Benchmarking and regression.