C11 alignas instead of unions
authorPeter Eisentraut <[email protected]>
Fri, 21 Nov 2025 08:57:06 +0000 (09:57 +0100)
committerPeter Eisentraut <[email protected]>
Fri, 21 Nov 2025 09:08:24 +0000 (10:08 +0100)
commit97e04c74bedb902327b89eb8a9e6aea01aabdad2
tree3b4af6c386011bdf378b5207bd36a135042bf202
parent266543a62055541ddefe4e66797e0e1e4aa8705a
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 <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/46f05236-d4d4-4b4e-84d4-faa500f14691%40eisentraut.org
src/backend/access/common/toast_internals.c
src/backend/commands/async.c
src/backend/storage/large_object/inv_api.c
src/include/c.h