Rul 2.5: Definition of a project and unused code

Moderators: misra-c, david ward

Post Reply
Posts: 4
Joined: Thu Mar 20, 2014 2:50 pm
Company: Klocwork

Rul 2.5: Definition of a project and unused code

Post by sca2012 » Tue Apr 18, 2017 9:56 pm

This questions would rather belong to a specific forum for discussions of glossary terms but I could not find the appropriate section. My original question deals with the definition of "Project". I'll use example of unused code, but this issue could also be discussed in a context of other rules.

Let's say, I build an executable that makes use of a library, whose headers, say, contain a certain macro definition. This macro is not used anywhere in the source code of the executable directly, but it is used somewhere inside the library.

Is this situation compliant with Rule 2.5?

What if this library is actually a third party library whose source code is not available? Should the library itself be MISRA-compliant for the using code to be compliant (and thus definition of a "project" should also contain libraries and not only an executables)?

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

Re: Rul 2.5: Definition of a project and unused code

Post by misra-c » Wed Jun 14, 2017 9:12 am

The term "project" applies to all code in the executable(s), including third party libraries. However the project management may choose to handle libraries in a different manner to the source code. This is discussed in Section 6.7.

MISRA published a document in April 2016, which includes a more detailed discussion of this topic.
"MISRA Compliance:2016 Achieving compliance with MISRA Coding Guidelines"
The document can be found by clicking on the above link or by looking either in the "Resources" section of the Bulletin Board or the Publications section of the MISRA web site.
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “8.2 Unused code”