Visual Studio 2017 15.8 includes a fix to properly handle std::make_shared used with over-aligned types. However, this is a breaking fix and requires the definition of one of two macros to either acknowledge being aware of the fix or disable the fix and return to the previous behavior. The Engine does not appear to define either macro, and there is no clear method for how to define either macro at the project level.
SETUP:
This repro requires Visual Studio 2017 15.8+.
REPRO:
struct alignas(16) large_aligned
{
int v;
};
void test()
{
auto blah = std::make_shared<large_aligned>();
}
RESULT:
The build fails with the following error: error C2338: You've instantiated std::aligned_storage<Len, Align> with an extended alignment (in other words, Align > alignof(max_align_t)). Before VS 2017 15.8, the member type would non-conformingly have an alignment of only alignof(max_align_t). VS 2017 15.8 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility (only for uses of aligned_storage with extended alignments). Please define either (1) _ENABLE_EXTENDED_ALIGNED_STORAGE to acknowledge that you understand this message and that you actually want a type with an extended alignment, or (2) _DISABLE_EXTENDED_ALIGNED_STORAGE to silence this message and get the old non-conformant behavior.
EXPECTED:
The build completes successfully.
I am not able to find world outliner how to enable it?
Delay nodes occasionally don't fire the "Completed" output in a nativized build
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
How can i modify the param name in EQS node
Installer 4.10 failed with error code R-1603
How does TextureRenderTarget2D get TArray<uint8> type data?
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-63560 in the post.
2 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.19.2, 4.20.2, 4.21 |
Target Fix | 4.22 |
Created | Aug 30, 2018 |
---|---|
Resolved | Sep 5, 2018 |
Updated | Feb 12, 2019 |