-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
MISRA-C - Do not use reserved names #9882
Comments
What's the semantics of the sys in the middle?
|
I missed the discussion earlier and was pointed here after the @pfl had already submitted. Regarding conventions, note that both _impl and _handler are only ever applied to syscalls, which are symbols in the public headers that already have (or should have, prior to this patch) well-formed namespaced names like "k_yield()" or whatever. I'd argue we don't need the "z" at all, and it's perfectly acceptable to do a mapping like Would also generally prefer to save bytes by not stuffing underscores into the middle of a prefix, so e.g. "zarch_" and "zsys_" make more sense to me. |
The original renaming list was written down by @ceolin so I'd guess it can be discussed and the scripts updated accordingly. |
Shall we go for
here? |
Works for me |
+1 it seems better go with
|
The C standard reserves all identifiers that begin with an underscore for implementation details. Zephyr is using underscore for identifiers and macros all over the project resulting in many violations. Bellow a suggestion to handle this:
_arch_
->z_arch_
_sys_
->z_sys_
_k_
->z_
_impl_
->z_sys_impl_
_handler_
->z_sys_handl_
z_
According to the C Standard, 7.1.3 [ISO/IEC 9899:2011]
Part of #9552
The text was updated successfully, but these errors were encountered: