The Trusted Firmware follows the [[ https://www.misra.org.uk/Activities/MISRAC/tabid/160/Default.aspx | MISRA C:2012 coding guidelines ]]. Coverity
Static Analysis is used regularly to generate a report of current defects and
prevent the addition of new ones.
It is not possible for this project to follow all guidelines. The attached
spreadsheet lists all rules and whether the TF aims to comply with them or
not, along with the rationale for each deviation. Note that enforcing a rule
doesn't mean that the codebase is free of defects of that rule, only that
ideally they would be removed.
Note that third-party libraries are not considered in the report (MbedTLS and
libfdt) and we don't intend to fix any defects found in them.
During 2017-2018 there has been an effort to cleanup the codebase of defects,
specially in all code used by BL31 (which is prioritary as it contains all
runtime code). The cleanup has been done mainly in common code and Arm
platforms. No fixes are done to third-party platforms, that is the
responsibility of the maintainers. Further efforts will be done in the future in
the form of general codebase refactoring.
The following graph shows the progress of the MISRA compliance work over the
last year and a half:{F24197}
{F24195}