agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
pgsql: pgindent: Fix indentation of alignas() in struct members 2+ messages / 1 participants [nested] [flat]
* pgsql: pgindent: Fix indentation of alignas() in struct members @ 2026-09-16 07:14 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 2+ messages in thread From: Peter Eisentraut @ 2026-09-16 07:14 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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. There is currently no code affected by this, but there are some pending patches that would be. 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 ------ master Details ------- https://git.postgresql.org/pg/commitdiff/884f82ae2621cc8d983bb745ce6c8c1c9a971764 Modified Files -------------- src/tools/pgindent/pgindent | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: pgindent: Fix indentation of alignas() in struct members @ 2026-09-23 07:32 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 2+ messages in thread From: Peter Eisentraut @ 2026-09-23 07:32 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-09-23 07:32 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-09-16 07:14 pgsql: pgindent: Fix indentation of alignas() in struct members Peter Eisentraut <peter@eisentraut.org> 2026-09-23 07:32 pgsql: pgindent: Fix indentation of alignas() in struct members Peter Eisentraut <peter@eisentraut.org>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox