context::set_language does not correctly set __cplusplus
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 56/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- C++
- Sterne
- 29
- Forks
- 56
- Ø Merge
- 3 T. 6 Std.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus boostorg/wave
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
-
Is it possible? Dumping preprocessor state at end of output so that preprocessing can be resumed?Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
Ähnliche Issues
-
area:decoder area:libnvmpi bug P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
gjrtimmer/jetson-nvmpi#164 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
redis/memtier_benchmark#850 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug-unconfirmed
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
Maintainer antworten meist innerhalb von 1 Tag
-
Status: Needs confirmation Status: Needs triage
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 77/100
FreeCAD/FreeCAD#33863 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
pawelsalawa/letos#5839 ·