-
Notifications
You must be signed in to change notification settings - Fork 56
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 compliance #77
Comments
You'll need to be more specific about what that means. |
MISRA is a set of guidelines for safety critical code. It includes things like restricting the usage of dynamic memory allocation (which is one of the reasons this project is pretty cool), avoiding side-effect in conditional statements and using clear control flow (single return point in a function, and not using break to terminate a loop). These rules may or may not be to your taste, so I would like to implement them in a personal fork so you can decide whether or not this is something you'd like to include. |
Indeed, there is no dynamic memory allocation in libprintf.
You mean, ternary operator applications? I have some of these which do a
Ok, sure. Please try to avoid any other changes though. When you have a PR, I'll consider it. Is there some sort of MISRA verification you want to have run? You could perhaps write a GitHub action for that. |
…y be preceded by other preprocessor directives or comments.
… be used with either a preceding `&`, or with a parenthesized parameter list, which may be empty.
…sed. ... so, when printf is used in C++, we use the C++-version of the C library headers.
…-like macro each instance of a parameter shall be enclosed in parentheses unless it is used as the operand of `#` or `##`.
So, I think this covers everything except the use of raw types. Is there an online MISRA compliance checker, by the way? |
We use SonarQube (https://www.sonarqube.org/) which does have a free edition, but this edition does not include coverage for C/C++. |
MISRA specs links (for myself...): |
It does seem the last commits somehow caused |
* More use of typedef's over raw primitive C types. Specifically, using `printf_size_t` in many relevant places * Regards #77 * Removed redundant parentheses * Comment tweaks
Umm... I don't see a duplicate |
You're right, my bad. I seem to be unable to keep my fork up to date with your changes. Merging your changes into my develop did not do what I would expect it to. |
@sanderh255 : I'm partly to blame, since I often rewrite the history of the develop branch. Only master is safe in that respect. So when working with the develop branch here it's usually better to rebase -i develop , and remove the redundant commits from the todo list. |
I see, that makes sense. Thanks!
…On Wed, Jan 5, 2022, 23:30 Eyal Rozenberg ***@***.***> wrote:
@sanderh255 <https://github.com/sanderh255> : I'm partly to blame, since
I often rewrite the history of the develop branch. Only master is safe in
that respect. So when working with the develop branch here it's usually
better to rebase -i develop , and remove the redundant commits from the
todo list.
—
Reply to this email directly, view it on GitHub
<#77 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATJHDWK457CVZ6WTVMZPFJTUUTBBJANCNFSM5KXAQARA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
* More use of typedef's over raw primitive C types. Specifically, using `printf_size_t` in many relevant places * Regards #77 * Removed redundant parentheses * Comment tweaks
…y be preceded by other preprocessor directives or comments.
… be used with either a preceding `&`, or with a parenthesized parameter list, which may be empty.
…sed. ... so, when printf is used in C++, we use the C++-version of the C library headers.
…-like macro each instance of a parameter shall be enclosed in parentheses unless it is used as the operand of `#` or `##`.
* More use of typedef's over raw primitive C types. Specifically, using `printf_size_t` in many relevant places * Regards #77 * Removed redundant parentheses * Comment tweaks
…sed. ... so, when printf is used in C++, we use the C++-version of the C library headers.
…-like macro each instance of a parameter shall be enclosed in parentheses unless it is used as the operand of `#` or `##`.
* More use of typedef's over raw primitive C types. Specifically, using `printf_size_t` in many relevant places * Regards #77 * Removed redundant parentheses * Comment tweaks
So, I think we're done with this issue. If I've missed something, please reopen. |
…y be preceded by other preprocessor directives or comments.
… be used with either a preceding `&`, or with a parenthesized parameter list, which may be empty.
…sed. ... so, when printf is used in C++, we use the C++-version of the C library headers.
…-like macro each instance of a parameter shall be enclosed in parentheses unless it is used as the operand of `#` or `##`.
* More use of typedef's over raw primitive C types. Specifically, using `printf_size_t` in many relevant places * Regards #77 * Removed redundant parentheses * Comment tweaks
…y be preceded by other preprocessor directives or comments.
… be used with either a preceding `&`, or with a parenthesized parameter list, which may be empty.
…sed. ... so, when printf is used in C++, we use the C++-version of the C library headers.
…-like macro each instance of a parameter shall be enclosed in parentheses unless it is used as the operand of `#` or `##`.
* More use of typedef's over raw primitive C types. Specifically, using `printf_size_t` in many relevant places * Regards #77 * Removed redundant parentheses * Comment tweaks
Critical embedded systems (medical and safety related) often require MISRA compliance. It would be great to implement this for the printf library.
The text was updated successfully, but these errors were encountered: