Rule 3.6: Supplied Libraries Compliance Check - Printable Version +- MISRA Discussion Forums (https://forum.misra.org.uk) +-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4) +--- Forum: MISRA-C: 2004 rules (https://forum.misra.org.uk/forumdisplay.php?fid=17) +---- Forum: 6.3 Documentation (https://forum.misra.org.uk/forumdisplay.php?fid=30) +---- Thread: Rule 3.6: Supplied Libraries Compliance Check (/showthread.php?tid=688) |
Rule 3.6: Supplied Libraries Compliance Check - MichelCampmas - 16-11-2009 We are using an ARM development suite where standard libraries are provided with the tool suite. Looking at the MISRA rules, I found quite a few which prohibit using such and such function (atoi, etc...). Which means that implicitly, the other functions can be used. However, rule 3.6 requires that all libraries (including the ones provided with the compiler) be "subjected to appropriate validation". Could you expand on what this means in regards to standard libraries? Do we need to require the vendor to certify he is MISRA compliant? If not possible, does this means we have to write our own version, so that we are sure it is compliant? Thanks Michel Campmas Cypress Semiconductor Re: Rule 3.6: Supplied Libraries Compliance Check - misra-c - 09-12-2009 If your implementation is a conforming freestanding implementation then the C99 language standard states that it must provide all the features associated with the headers , , , , , , and . For C90, the list is a little shorter. For a hosted implementation, it is all the headers defined by the standard. Within these headers, MISRA C prohibits some functions because of known issues. As you say, anything else is implicitly OK to use, subject to appropriate validation having been performed. The key word here is appropriate. This could mean that the compiler vendor certifies that the libraries are MISRA compliant, possibly also providing you with evidence to back up the claim. Alternatively some vendors, particularly of embedded development kits, may provide you with the source code for the library in which case you can treat it in the same manner as your own source code. The worst case scenario is, of course, that you may need to generate your own equivalents of some library functions. |