context::set_language does not correctly set __cplusplus
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
Hướng nghiên cứu
Start by locating context::set_language and the boost:👋:language_support definitions, then inspect how each language mode assigns __cplusplus. Compare the existing values with the documented C++ standard values in the linked reference. Done means released C++ versions have dedicated support_cppXX values and preprocessing reports the corresponding __cplusplus value.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I am using wave as library in a tool which preprocesses C++ code to obtain some information and then lint it.
This requires preprocessing the code with a proper value for __cplusplus, as the code might use different #if .. branches depending on the value.
I know the C++ standard of the project. But I can't set __cplusplus myself because it is a special value which wave ignores when using the context::remove_macro_definition or context::add_macro_definition functions. This is fine, since the public API context::set_language exists.
However, I believe this API does not behave as expected:
boost::wave::language_support::support_cpp14does not exists, thus one cannot set__cplusplusaccordinglyboost::wave::language_support::support_cpp17sets__cplusplusto199711L, aka C++98boost::wave::language_support::support_cpp23sets__cplusplusto199711L, aka C++98boost::wave::language_support::support_cpp14boost::wave::language_support::support_cpp26does not exists, thus one cannot set__cplusplusaccordingly. To be fair, C++26 is quite new and this point is more for completeness sake.
On the other hand, boost::wave::language_support::support_cpp, boost::wave::language_support::support_cpp11 and boost::wave::language_support::support_cpp20 cause __cplusplus to be set to the expected value.
I believe wave should offer a dedicated boost::wave::language_support::support_cppXX value for each released C++ version and set __cplusplus accordingly for preprocessing according to the values documented here
If you agree with the request I am happy to create a contribution for that.
- Ngôn ngữ chính
- C++
- Star
- 29
- Fork
- 56
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 4
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/wave
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Link errors on WindowsĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Switch to reusable CI flowCó thể làm lại được @jefftrull đã nhận 206 ngày trước và không có pull request nào đang mở. Đang mở
Tất cả issue của boostorg/wave
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
objectionary/eo-graphs#80 ·
-
bug C/C++ code
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
webarkit/WebARKitLib#85 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SD Card Size correctionĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
[request] vsg/1.1.16Đang mởupstream update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
conan-io/conan-center-index#31142 ·
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 72/100