From cb4a36935669a3c7f34b065aa8aa9953f506c758 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Thu, 11 Jun 2020 14:48:16 -0400 Subject: Fix placement of alignas() specifier The alignment specifier must appear before the typename i.e. clang9 refused to compile uint8_t alignas(MAX_ALIGN) __reserved[128]; but accepted alignas(MAX_ALIGN) uint8_t __reserved[128]; --- include/libunwind-aarch64.h | 2 +- include/unwind.h | 2 +- src/mi/mempool.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/libunwind-aarch64.h b/include/libunwind-aarch64.h index d1bd8708..d78fbd44 100644 --- a/include/libunwind-aarch64.h +++ b/include/libunwind-aarch64.h @@ -194,7 +194,7 @@ struct unw_sigcontext uint64_t sp; uint64_t pc; uint64_t pstate; - uint8_t alignas(16) __reserved[(66 * 8)]; + alignas(16) uint8_t __reserved[(66 * 8)]; }; typedef struct diff --git a/include/unwind.h b/include/unwind.h index 8eb5ff75..93780fad 100644 --- a/include/unwind.h +++ b/include/unwind.h @@ -77,7 +77,7 @@ typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action, even on 32-bit machines for gcc compatibility. */ struct _Unwind_Exception { - uint64_t alignas(8) exception_class; + alignas(8) uint64_t exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; unsigned long private_1; unsigned long private_2; diff --git a/src/mi/mempool.c b/src/mi/mempool.c index 3e8da676..7c5d27d0 100644 --- a/src/mi/mempool.c +++ b/src/mi/mempool.c @@ -41,7 +41,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # define MAX_ALIGN MAX_ALIGN_(sizeof (long double)) #endif -static char alignas(MAX_ALIGN) sos_memory[SOS_MEMORY_SIZE]; +static alignas(MAX_ALIGN) char sos_memory[SOS_MEMORY_SIZE]; static _Atomic size_t sos_memory_freepos = 0; static size_t pg_size; -- cgit v1.2.1