pgsql: C11 alignas instead of unions

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: C11 alignas instead of unions
Date: 2025-11-21 09:29:36
Message-ID: E1vMNSR-000bz2-1e@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)evan(dot)chao(at)gmail(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2025-11-21 12:14:55 pgsql: Update timezone to C99
Previous Message Nathan Bossart 2025-11-20 23:09:31 Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent