context::set_language does not correctly set __cplusplus
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C++
- スター
- 29
- フォーク
- 56
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/wave のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
Is it possible? Dumping preprocessor state at end of output so that preprocessing can be resumed?オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
mudler/parakeet.cpp#99 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
raspberrypi/rpi-imager#1773 ·
メンテナーはふだん 1 日以内に返信