From 2f17e969e48ab4a0e93c14750e4b500ba46fe6a6 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 5 Jul 2018 06:24:29 +0000 Subject: [PATCH] [demangler] Avoid alignment warning The alignment specified by a constant for the field `BumpPointerAllocator::InitialBuffer` exceeded the alignment guaranteed by `malloc` and `new` on Windows. This change set the alignment value to that of `long double`, which is defined by the used platform. It fixes https://bugs.llvm.org/show_bug.cgi?id=37944. Differential Revision: https://reviews.llvm.org/D48889 llvm-svn: 336312 --- libcxxabi/src/cxa_demangle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp index d70ffdf10651..901db66b2700 100644 --- a/libcxxabi/src/cxa_demangle.cpp +++ b/libcxxabi/src/cxa_demangle.cpp @@ -1890,7 +1890,7 @@ class BumpPointerAllocator { static constexpr size_t AllocSize = 4096; static constexpr size_t UsableAllocSize = AllocSize - sizeof(BlockMeta); - alignas(16) char InitialBuffer[AllocSize]; + alignas(long double) char InitialBuffer[AllocSize]; BlockMeta* BlockList = nullptr; void grow() {