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

[BUG] Violation of MISRA2012 rule 17.11 - A function that never returns should be declared with a _Noreturn function specifier #1057

Closed
markhermeling opened this issue May 14, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@markhermeling
Copy link

Describe the bug
In the Coverity example configuration there are 4 places where a function is used that does not return. See the attached SARIF file from a run with CodeSecure CodeSonar. This is a violation of MISRA 17.11, though admittedly not a key rule.

Target

  • coverity UP and SMP configurations

Host

  • Linux

To Reproduce

  • run codesonar analyze -preset misra2012 on project

Expected behavior
The specified functions should be defined with _Noreturn, or rule 17.11 should be added as a deviation. I am happy to provide a PR with either of these done, but wanted to file the issue first to understand what the project prefers.

I am working on a few more MISRA violation as it seems that Coverity missed a few rules. Once done, I plan to submit a codesonar example project as well to make it easier for users to run CodeSonar on FreeRTOS.

Misra17-11-violations.sarif.zip

@markhermeling markhermeling added the bug Something isn't working label May 14, 2024
@kar-rahul-aws
Copy link
Member

Hi @markhermeling
Thank you for reporting the issue.
We are having a discussion with the team, on the proper approach to address the issue for all ports.
We will reply back shortly, with the proposed changes, if any.

Thanks.

@kar-rahul-aws
Copy link
Member

Hi @markhermeling
We have raised a PR #1060 to address the issue you reported. Can you please test with this patch and let us know if this fixes your issue?

Thanks.

@markhermeling
Copy link
Author

We are having a discussion with the team, on the proper approach to address the issue for all ports.

I have another couple of issues to report. Looking for suggestions from the team as to how to approach.

What I would like to do is to submit a codesonar example and make a PR with that and suggested code changes if that is easiest.

I can also add CodeSonar either to the pipeline in the repo, or run it once per day and publish the results.

@n9wxu
Copy link
Member

n9wxu commented May 17, 2024

We recently started running sonarcube experimentally but it is not tied to PR checks and we may have different configurations. The easiest path may be submitting a PR with a test run and your changes. Then we can directly comment on the proposed changes and discuss any configuration differences.

@n9wxu
Copy link
Member

n9wxu commented May 17, 2024

Looks like the kernel is doing sonar checks in the PR. This PR shows the result.
#353

@kar-rahul-aws
Copy link
Member

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
None yet
Development

No branches or pull requests

3 participants