Do BLAS and LAPACK libraries comply with MISRA standard?

血红的双手。 提交于 2020-01-16 08:35:55


I guess the answer is no. However, I was wondering if someone has some insight into this topic.

Do BLAS and LAPACK libraries comply with MISRA standards? The MISRA standards (MISRA C:1998, MISRA C:2004, MISRA C:2012) are extremly demanding, and I believe that BLAS and LAPACK libraries do not comply with it. Hence, I should not use such libraries if my software project demands MISRA compliance.

Any insight into this question would be extremly appreciated :)


Unless the library is actively advertised as MISRA-C compliant, it is pretty safe to assume that it isn't.

There's basically various levels of strictness you can apply to your project. Either you do some "MISRA light" where your own application fulfils MISRA but the libraries does not. Or you demand that every library, including standard libraries, are MISRA compliant.

The former is ok if you are just using MISRA as a bug-killing standard. But in case you are using MISRA because of safety requirements, then all libraries must comply - including to some extent the compiler's standard library (if used).


Let me point you at MISRA Compliance:2016 which deals in more detail with the thorny issue of achieving MISRA Compliance - and can be retrofitted onto ANY of the MISRA language guidelines.

The section on Adopted Code should help answer your question - and in simple terms, unless the library comes with an appropriate Compliance Summary, then the answer in No.

Whether you should use such libraries in production code is a matter for you (and your project) - appropriate documentation (and additional V&V may be adequate) - and this will impact your own Compliance.

{ please note profile for disclaimer }