context::set_language does not correctly set __cplusplus
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 56/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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__cplusplusaccordingly https://github.com/boostorg/wave/pull/275 -
boost::wave::language_support::support_cpp17sets__cplusplusto199711L, aka C++98 https://github.com/boostorg/wave/pull/264 -
boost::wave::language_support::support_cpp23sets__cplusplusto199711L, aka C++98 https://github.com/boostorg/wave/pull/264 -
boost::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. https://github.com/boostorg/wave/pull/276
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.
- Langage dominant
- C++
- Étoiles
- 29
- Forks
- 56
- Merge moyen
- 1 j 3 h
- PR mergées (30 j)
- 6
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de boostorg/wave
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
-
Is it possible? Dumping preprocessor state at end of output so that preprocessing can be resumed?Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
Toutes les issues de boostorg/wave
Issues similaires
-
parse_selu lowering loses catastrophic cancellation → silent 0.0 for moderate positive inputsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
ROCm/AMDMIGraphX#5490 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
arvidn/libtorrent#9126 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Sunrisepeak/mcpp-language-server#80 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
#2754 make deepseek api not workOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
xiaoyifang/goldendict-ng#3148 ·
Les mainteneurs répondent en général sous 1 jour