agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgindent: Fix indentation of alignas() in struct members
Date: Wed, 23 Sep 2026 07:32:22 +0000
Message-ID: <E1x9HSo-00000000sjR-1vVL@gemulon.postgresql.org> (raw)
pgindent: Fix indentation of alignas() in struct members
pg_bsd_indent doesn't know about alignas(), so a struct member
declared with it is misindented unless it's the first member.
Disguise each alignas(...) call as a plain identifier while
indenting, restoring it afterward. Stash the call's original text
by index rather than embedding it in the placeholder: embedding only
works for a single-token argument, and fails to match at all against
nested parens (e.g. alignas(sizeof(x))) or a line break, silently
skipping the disguise.
This is backpatched to PostgreSQL 19 because it is by coincidence
needed for a bug fix.
Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
Co-authored-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/94a128da-bf3e-46bd-9e2d-609573c484da@eisentraut.org
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/c81972f36593bc1ef20f8d899c916493c689ffa4
Modified Files
--------------
src/tools/pgindent/pgindent | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
view thread (2+ messages)
Message-ID: <E1x9HSo-00000000sjR-1vVL@gemulon.postgresql.org>
Permalink: ../E1x9HSo-00000000sjR-1vVL@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1x9HSo-00000000sjR-1vVL@gemulon.postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: pgindent: Fix indentation of alignas() in struct members
In-Reply-To: <E1x9HSo-00000000sjR-1vVL@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox