MSVC clang-cl causes redefinition error
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Kiểm tra include/boost/type_traits/type_with_alignment.hpp quanh hai khối định nghĩa ở các dòng 86–206, bắt đầu với các điều kiện tiền xử lý được hiển thị trong issue. Tạo một trường hợp nhỏ bằng lệnh clang-cl được cung cấp và xác nhận rằng chỉ một khối được chọn, đồng thời các lỗi định nghĩa lại từ a8 đến a128 đã biến mất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In this two blocks of definitions we have:
#if (defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS)
[...]
#endif
#if (defined(BOOST_MSVC) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && !defined(BOOST_TT_DISABLE_INTRINSICS)
[...]
#endif
Problem is when using clang-cl both __clang__ and BOOST_MSVC are defined hence the preprocessor does not discard either of the two blocks.
As a result the redefinition error.
The two definition blocks are obviously mutually exclusive hence should be chained by #elif.
Here a sample.
C:\PROGRA~1\MICROS~4\18\COMMUN~1\VC\Tools\Llvm\x64\bin\clang-cl.exe /nologo -TP -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DBOOST_ASIO_NO_DEPRECATED -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_CONTAINER_DYN_LINK -DBOOST_CONTAINER_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_FILESYSTEM_NO_LIB -DBOOST_LOG_DYN_LINK -DBOOST_LOG_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_SERIALIZATION_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DBOOST_THREAD_USE_DLL -DNOMINMAX -DNO_MISALIGNED_ACCESSES -DOPENSSL_API_COMPAT=0x10100000L -DPSAPI_VERSION=2 -DVC_EXTRALEAN -DWIN32_LEAN_AND_MEAN -D_SCL_SECURE_NO_WARNINGS -D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING -D_WIN32_WINNT=0x0A00 -I<myproject> -I<myproject>\src -imsvc<myproject>\build\Debug\vcpkg_installed\x64-windows\include /DWIN32 /D_WINDOWS /EHsc /Ob0 /Od /RTC1 -std:c++17 -MDd -Zi /permissive- /Zc:__cplusplus /W4 /WX /w44287 /w44388 /wd4127 /wd4068 /wd4324 /wd4701 /wd4714 /wd5030 /GA /EHsc /MDd -Wno-c++20-extensions /std:c++17 /showIncludes /Fosrc\xxxxxxx\config\CMakeFiles\xxxxxxx.config.dir\PeersConfiguration.cpp.obj /Fdsrc\xxxxxxx\config\CMakeFiles\xxxxxxx.config.dir\xxxxxxx.config.pdb -c -- <myproject>\src\xxxxxxx\config\PeersConfiguration.cpp
In file included from <myproject>\src\xxxxxxx\config\PeersConfiguration.cpp:32:
In file included from <myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/property_tree/json_parser.hpp:14:
In file included from <myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/property_tree/ptree.hpp:16:
In file included from <myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/property_tree/string_path.hpp:15:
In file included from <myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/property_tree/id_translator.hpp:16:
In file included from <myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/optional/optional.hpp:37:
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(133,29): error: redefinition of 'a8'
133 | struct __declspec(align(8)) a8 {
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(90,40): note: previous definition is here
90 | struct __attribute__((__aligned__(8))) a8 {};
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(137,30): error: redefinition of 'a16'
137 | struct __declspec(align(16)) a16 {
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(91,41): note: previous definition is here
91 | struct __attribute__((__aligned__(16))) a16 {};
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(141,30): error: redefinition of 'a32'
141 | struct __declspec(align(32)) a32 {
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(92,41): note: previous definition is here
92 | struct __attribute__((__aligned__(32))) a32 {};
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(145,30): error: redefinition of 'a64'
145 | struct __declspec(align(64)) a64
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(93,41): note: previous definition is here
93 | struct __attribute__((__aligned__(64))) a64 {};
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(150,31): error: redefinition of 'a128'
150 | struct __declspec(align(128)) a128 {
| ^
<myproject>\build\Debug\vcpkg_installed\x64-windows\include\boost/type_traits/type_with_alignment.hpp(94,42): note: previous definition is here
94 | struct __attribute__((__aligned__(128))) a128 {};
- Ngôn ngữ chính
- C++
- Star
- 65
- Fork
- 88
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của boostorg/type_traits
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
boostorg/type_traits#208 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
boostorg/type_traits#207 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
boostorg/type_traits#202 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
boostorg/type_traits#201 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
boostorg/type_traits#196 ·
Tất cả issue của boostorg/type_traits
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
sav-oss-org/ptusa_main#1610 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Command gate: one shared constant for the just-below-1e-9 MoveAxis stop epsilon (ZWO, Bisque)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
open-astro/AlpacaBridge#2606 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Refactor force_torque_system integration test to use EcmScopeCó thể đã có người làm @patelshivani2283-lab đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Niko1221/Strata#6731 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100