Re: alignas (C11)
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-12T15:09:14Z
Lists: pgsql-hackers
On 12.11.25 15:02, Andres Freund wrote: > Hi, > > On 2025-11-12 12:39:19 +0100, Peter Eisentraut wrote: >> - You cannot use alignas on a typedef. So some uses of the attribute >> pg_attribute_aligned() like for PgAioUringContext or the whole int128 >> business cannot be converted directly. The solution for cases like >> PgAioUringContext could be to move the alignas into the struct, but I >> haven't studied this code closely enough, so I'm leaving it. For int128, >> there is no straightforward solution, so I'm also leaving that as is. > > Maybe I'm confused, but the aligned attribute for PgAioUringContext is on the > struct, not the typedef, no? Yes, you're right. The immediate problem there is that alignas is not syntactically valid at all at that position.
Commits
-
Further fix extended alignment for older g++.
- bd9dfac8b121 19 (unreleased) landed
-
Disable extended alignment uses on older g++
- 6ceef9408c26 19 (unreleased) landed
-
Work around buggy alignas in older g++
- a9bdb63bba8a 19 (unreleased) landed
-
Use C11 alignas in pg_atomic_uint64 definitions
- e7075a3405cc 19 (unreleased) landed
-
C11 alignas instead of unions -- extended alignments
- d4c0f91f7d57 19 (unreleased) landed
-
C11 alignas instead of unions
- 97e04c74bedb 19 (unreleased) landed
-
Add <stdalign.h> to c.h
- 300c8f532478 19 (unreleased) landed