pgsql: pgindent: Keep the alignas() placeholder the same width

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pgindent: Keep the alignas() placeholder the same width
Date: 2026-10-02 08:16:37
Message-ID: E1xCYRZ-000000026Y7-0JbL@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pgindent: Keep the alignas() placeholder the same width

pre_indent() hides each alignas(...) call from pg_bsd_indent behind
a plain identifier, because pg_bsd_indent has a fixed table of
declaration keywords and lexes anything else followed by "(" as the
start of an expression.

The placeholder was not the same width as the text it stood in for,
though, and pg_bsd_indent decides where to put a trailing comment from
the width of the code preceding it. A member declared with alignas()
and carrying a trailing comment therefore got the comment separated by
a tab where the real width calls for a single space, or the other way
round. Pad the placeholder out to the original width so that the
decision is made on the real width.

No member currently declared with alignas() has a trailing comment, so
this changes nothing in the tree today; it is a correctness fix for the
helper.

Author: Tristan Partin <tristan(at)partin(dot)io>
Co-authored-by: Peter Eisentraut <peter(at)eisentraut(dot)org>
Discussion: https://www.postgresql.org/message-id/flat/DKBEBF32QLUA.3L2DJRPUYNKHZ%40partin.io

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/305cbed95d197dfa2ea946678c0abd26113654eb

Modified Files
--------------
src/tools/pgindent/pgindent | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2026-10-02 10:29:20 pgsql: Use the relation map's index when searching deleted tuples seque
Previous Message Michael Paquier 2026-10-02 08:03:47 pgsql: pg_dump: Include column statistics for index-backed constraints