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

Regulate GNUism in Zephyr codebase #52226

Open
4 tasks
stephanosio opened this issue Nov 14, 2022 · 1 comment
Open
4 tasks

Regulate GNUism in Zephyr codebase #52226

stephanosio opened this issue Nov 14, 2022 · 1 comment
Assignees
Labels
area: Portability Standard compliant code, toolchain abstraction area: Toolchains Toolchains Meta A collection of features, enhancements or bugs

Comments

@stephanosio
Copy link
Member

stephanosio commented Nov 14, 2022

Preface

Zephyr codebase currently contains many "GNUisms" (GCC-specific constructs) in the assembly and C code because the majority of its developers use the GCC compiler and the upstream CI uses the Zephyr SDK toolchain, which is based on the GCC compiler, to test the submitted patches.

The extensive use of GNUisms throughout the Zephyr codebase creates various portability issues, especially for the proprietary compilers like IAR that strictly adhere to the ISO C standard and do not implement the GNU extensions.

In order to ensure that the Zephyr codebase remains portable and compatible with the compilers other than GCC, it is necessary to set guidelines on the GNU extension usage and regulate them at the project level.

Tasks

Toolchain WG

  • Identify GNU extensions currently in use and evaluate their importance and alternatives.
  • Set guidelines on the GNU extension usage (per extension).
    • If a GNU extension is essential to Zephyr codebase and there is no standard alternative, the extension usage shall be unconditionally allowed (a notorious example of such is "statement expression").
    • If a GNU extension is not essential but can be sufficiently valuable in improving code quality and/or performance, the extension usage shall be allowed, provided that a fallback mechanism is implemented (a notorious example of such is "builtin functions").
    • If a GNU extension is not essential and an equivalent standard alternative is available, the extension usage shall be disallowed.
  • Evaluate enforcement strategies (per extension).
  • Implement enforcement strategies.

Resources

@zephyrbot
Copy link
Collaborator

Hi @stephanosio, @tejlmand,

This issue, marked as an Issue, was opened a while ago and did not get any traction. Please confirm the issue is correctly assigned and re-assign it otherwise.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Portability Standard compliant code, toolchain abstraction area: Toolchains Toolchains Meta A collection of features, enhancements or bugs
Projects
None yet
Development

No branches or pull requests

3 participants