Rule 3.6: Supplied Libraries Compliance Check

6.3 Documentation

Moderators: misra-c, david ward

Post Reply
Posts: 1
Joined: Fri Nov 13, 2009 7:04 pm
Company: Cypress Semiconductor

Rule 3.6: Supplied Libraries Compliance Check

Post by MichelCampmas » Mon Nov 16, 2009 6:21 pm

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?
Michel Campmas
Cypress Semiconductor

Posts: 572
Joined: Thu Jan 05, 2006 1:11 pm

Re: Rule 3.6: Supplied Libraries Compliance Check

Post by misra-c » Wed Dec 09, 2009 1:41 pm

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 <float.h>, <iso646.h>, <limits.h>, <stdarg.h>, <stdbool.h>, <stddef.h>, and <stdint.h>. 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.
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “6.3 Documentation”