From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: C11 alignas instead of unions
Date: Fri, 21 Nov 2025 09:29:36 +0000
Message-ID: <E1vMNSR-000bz2-1e@gemulon.postgresql.org> (raw)
C11 alignas instead of unions
This changes a few union members that only existed to ensure
alignments and replaces them with the C11 alignas specifier.
This change only uses fundamental alignments (meaning approximately
alignments of basic types), which all C11 compilers must support.
There are opportunities for similar changes using extended alignments,
for example in PGIOAlignedBlock, but these are not necessarily
supported by all compilers, so they are kept as a separate change.
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/46f05236-d4d4-4b4e-84d4-faa500f14691%40eisentraut.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/97e04c74bedb902327b89eb8a9e6aea01aabdad2
Modified Files
--------------
src/backend/access/common/toast_internals.c | 4 +---
src/backend/commands/async.c | 14 +++++---------
src/backend/storage/large_object/inv_api.c | 8 ++------
src/include/c.h | 10 +++-------
4 files changed, 11 insertions(+), 25 deletions(-)
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: C11 alignas instead of unions
In-Reply-To: <E1vMNSR-000bz2-1e@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox