Re: alignas (C11)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-01-23T22:18:44Z
Lists: pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes: > On 23.01.26 18:33, Tom Lane wrote: >> Not sure what to do about that, but I do read it as indicating that we >> cannot put any faith in the compiler to honor such large alignment >> demands. > I think we could work around it like this: > #if defined(__cplusplus) && defined(__GNUC__) && __GNUC__ <= 6 > #define alignas(a) __attribute__((aligned(a))) > #endif Hmm, yeah, their bug #70066 shows clearly that the __attribute__ spelling should work. But I think we'd better make the cutoff be version 9 not version 6, because that same bug is quite clear about when they fixed it. The lack of complaints from the buildfarm may just indicate a lack of animals running the intermediate versions. regards, tom lane
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