compile failure with VS 2015 Update 3

Hello,

has anyone tried to compile LLDB with Visual Studio 2015 Update 3 ?

It compiles fine with Update 2, but with Update 3 we get error messages like:

D:\dev\llvm\tools\lldb\include\lldb/Target/Process.h(3194): error C2719:
‘default_stop_addr’: formal parameter with requested alignment of 8 won’t be aligned
(compiling source file D:\dev\llvm\tools\lldb\source\Expression\FunctionCaller.cpp)

although there is no __declspec(align) on that parameter.

We reported the issue to Microsoft here:

-Philippe

Compiling for 32-bit or 64-bit?

This question looks relevant: http://stackoverflow.com/questions/21743144/using-stdatomic-with-aligned-classes

32-bit.

default_stop_addr is an Address which contains a std::atomic<lldb::addr_t>. The addr_t is a 64-bit value, so I assume it needs 64-bit alignment. The answers on that StackOverflow question claim that 32-bit MSVC never does more than 32-byte alignment. So my guess is that this has always been a problem, and the newer compiler is just better at reporting it.

I left out some words. I meant:

The answers on that StackOverflow question claim that 32-bit MSVC never does more than 32-byte alignment for parameters.

Right, the x86_32 calling convention that MSVC uses fails to align such objects, and this is the error you get if you try. VS 2015 update 3 probably added __declspec(align(8)) to std::atomic<__int64>, triggering this error if you pass one or an object that contains one by value.

So without declspec(align(8)) was this a silent codegen bug in update 2?

Despite the error message, I don’t think this happens on a pass by value, as std atomic is not copyable