MISRA Discussion Forums
Rul 2.5: Definition of a project and unused code - 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:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21)
+---- Forum: 8.2 Unused code (https://forum.misra.org.uk/forumdisplay.php?fid=157)
+---- Thread: Rul 2.5: Definition of a project and unused code (/showthread.php?tid=1337)



Rul 2.5: Definition of a project and unused code - sca2012 - 18-04-2017

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)?


Re: Rul 2.5: Definition of a project and unused code - misra-c - 14-06-2017

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.