Closed ivanperez-keera closed 8 months ago
Change Manager: Verified that:
Solution is implemented:
[X] The code proposed compiles and passes all tests. Details: Build log: https://app.travis-ci.com/github/Copilot-Language/copilot/builds/268174325
[X] The solution proposed produces the expected result. Details:
The new image already includes a new test in the CI setup that uses cppcheck
to check that a Copilot-generated C file complies with MISRA C. I have manually checked that the test is being executed by the CI setup (see: https://app.travis-ci.com/github/Copilot-Language/copilot/jobs/615908458#L1976-L1978).
Furthermore, I have additionally used Parasoft to check the same example for compliance. Parasoft's tool reports a violation of one advisory only: Directive 4.6. Complying with that recommendation would require using specific types that indicate the size and signedness instead of float
and double
. Although we could call those float32_t
and float64_t
, there is in principle no guarantee that those will be the sizes in all architectures, making such names potentially misleading. Since this is a recommendation, we decide to accept non-compliance with this directive.
Adjust C99 backend to comply with all MISRA C 2012 rules (up to date with MISRA C 2023), as prescribed in the solution proposed for #472.
This commit does not modify the README just yet, contrary to the suggested solution to #472. This is intentional: there is no suitable place to indicate information about compliance, or lack thereof, with MISRA C. I suggest we open a separate issue extending the README and showing the features of Copilot more prominently. That will create the space to talk about MISRA compliance and also list the advisory we do not currently comply with.