For whatever reason, on x86_64 gcc allocates any static array at least
32 bytes in size with 32 byte alignment. In the case of things like
constant string tables, this ends up wasting a bunch of space for no
obvious reason.
Adding suitable _Alignas directives works to prevent overalignment.
-Subproject commit cba6ab66683d20b46def45f691fa7c750f3f9a2b
+Subproject commit b6ec120435a070a28eafe0b3e686ef2ac9b0f042
AC_C_FLEXIBLE_ARRAY_MEMBER
AC_C_INLINE
DX_C_FOR_DECLARATIONS
+DX_C_ALIGNAS
AM_PROG_AR
LT_INIT
static void set_err(unsigned code, struct cdecl_error *err)
{
- static const char errmsgs[] = STRTAB_INITIALIZER;
+ static const char _Alignas(1) errmsgs[] = STRTAB_INITIALIZER;
switch (code) {
case CDECL__ENOMEM:
#!/bin/awk -f
#
-# Copyright © 2021, 2023 Nick Bowler
+# Copyright © 2021, 2023-2024 Nick Bowler
#
# Generate a function to return the C keyword corresponding to a specifier
# type as a string, for internal use by the output routines.
print "static const char *spec_string(unsigned type)"
print "{"
- print "\tstatic const uint_least8_t idx[] = {";
+ print "\tstatic const unsigned char _Alignas(1) idx[] = {";
print "\t\t" offset_table;
print "\t};\n";