Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C and C++ language standards support is inconsistent and missing some standards versions #1785

Open
EaselinkBachmann opened this issue Sep 24, 2024 · 0 comments · May be fixed by #1799
Open
Assignees
Labels
bug Something isn't working

Comments

@EaselinkBachmann
Copy link

Describe the bug

The CMake build system generated by cmsis-toolbox has inconsistent support for some standards:

  • The GNU variants for C standards c17 (gnu17) and c23 (gnu23) are missing. This is unexpected, since the non-GNU variant is supported
  • The C++ standards c++20 and gnu++20 are incorrectly mapped to c++17 and gnu++17, leading to confusing behaviour. Either c++20 should be accepted and lead to actual C++20 support being enabled in the compiler, or c++20 should be rejected. Accepting c++20 and silently downgrading to c++17 is confusing.

As an additional enhancement, the following missing language standards should be added:

  • c++23
  • gnu++23

To Reproduce

Specify language-C: gnu17 or language-C: gnu23 in a .cproject.yml file and attempt to build the project. The build fails with unknown 'language' value 'gnu17' !.

Specify language-CPP: c++20 or language-CPP: gnu++20 in a .cproject.yml file and attempt to build a project containing C++20 features (such as requires clauses). The build fails with C++ syntax errors due to the mode not being C++20.

Expected behavior

Language standard support should be consistent and either correctly passed to the compiler or not implemented.

Environment (please complete the following information):

  • cmsis-toolbox 2.6.0
  • armclang 6.21.0
  • OS: Linux

Additional context

New issue as suggested in #1703.

@EaselinkBachmann EaselinkBachmann added the bug Something isn't working label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

2 participants