Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

absl::meta Alignment test, CMake-based build compilation issue with Visual Studio 2017 (>= v15.8) #193

Closed
Mizux opened this issue Oct 17, 2018 · 0 comments

Comments

@Mizux
Copy link
Contributor

Mizux commented Oct 17, 2018

Description

With Visual Studio 2017 >= 15.8, there is a (breaking ABI) change on extended alignment.

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.

Protocol

This error C2338, can be easily reproduce with Appveyor CI jobs or as follow

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
cmake -H. -Bbuild -DABSL_RUN_TESTS=ON -DABSL_USE_GOOGLETEST_HEAD=ON -G "Visual Studio 15 2017 Win64"
cmake --build build --config Release --target ALL_BUILD
cmake --build build --config Release --target RUN_TESTS

Got error:

uilding Custom Rule C:/projects/abseil-cpp/absl/meta/CMakeLists.txt
  CMake does not need to re-run because C:/projects/abseil-cpp/build/absl/meta/CMakeFiles/generate.stamp is up-to-date.
  type_traits_test.cc
c:\projects\abseil-cpp\absl\base\throw_delegate_test.cc(64): warning C4101: 'e': unreferenced local variable [C:\projects\abseil-cpp\build\absl\base\throw_delegate_test_bin.vcxproj]
  c:\projects\abseil-cpp\absl\base\throw_delegate_test.cc(90): note: see reference to function template instantiation 'void `anonymous-namespace'::ExpectThrowNoWhat<std::bad_function_call>(void (__cdecl *)(void))' being compiled
  absl_symbolize.vcxproj -> C:\projects\abseil-cpp\build\absl\debugging\Release\absl_symbolize.lib
c:\projects\abseil-cpp\absl\meta\type_traits_test.cc(742): 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.
...

src: https://ci.appveyor.com/project/Mizux/abseil-cpp/builds/19577145/job/xfqk597tlgih3uj1#L353

@Mizux Mizux changed the title absl::meta Alignment test compilation issue with Visual Studio 2017 (VS 15.8 >=) absl::meta Alignment test compilation issue with Visual Studio 2017 (>= v15.8) Oct 19, 2018
@Mizux Mizux changed the title absl::meta Alignment test compilation issue with Visual Studio 2017 (>= v15.8) absl::meta Alignment test, CMake-based build compilation issue with Visual Studio 2017 (>= v15.8) Oct 19, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 24, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 25, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 26, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 26, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 26, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 26, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 26, 2018
Mizux added a commit to Mizux/abseil-cpp that referenced this issue Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant