Re: alignas (C11)

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-12-01T07:03:49Z
Lists: pgsql-hackers
On 12.11.25 12:39, Peter Eisentraut wrote:
> Here, I'm proposing to make some use of the alignas specifier.  This 
> takes the place of compiler extensions such as 
> __attribute__((aligned(a))) and __declspec(align(a)), packaged up as 
> pg_attribute_aligned(a), which are used in a variety of places.  Also, 
> we can simplify some places where unions are used to encourage 
> alignment, and remove a few workaround for lack of alignment attribute 
> support.

This patch set has been committed, it looks like without buildfarm 
complaints.




Commits

  1. Further fix extended alignment for older g++.

  2. Disable extended alignment uses on older g++

  3. Work around buggy alignas in older g++

  4. Use C11 alignas in pg_atomic_uint64 definitions

  5. C11 alignas instead of unions -- extended alignments

  6. C11 alignas instead of unions

  7. Add <stdalign.h> to c.h