This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler: MISRA-C Compiance with HALCoGen

Other Parts Discussed in Thread: HALCOGEN

Tool/software: TI C/C++ Compiler

Our project requires code generation compliant with MISRA-C.

We are using latest versions of

-       HalCoGen (V4.06.01)

-       SafeTI libraries (2.3.1)

-       CCS  Version: 7.1.0.00016

-       compiler TI v17.3.0.STS

In particular,

Safety library \ include \ sl_types.h,

generates almost 1000 MISRA-C compliance errors if rule 19 is enabled during compiling.  There are many other TI source code files that generate warnings.

We would expect that all HalCoGen source code and safety libraries would be MISR-C compliant.

If we enable all of the MISRA-C rules then many 1000’s of warnings are generated.  Too many for us to manage.

This is a serious problem for us as we need to prove MISRA-C compliance.

How can we solve this issue with non-compliance of the provided source codes?

Can the MISR-C checking be applied to specific source code files? ie our source code files to help speed up compilation and manage the number of warnings?

Regards

Rob

  • Hello Rob,

    The MISRA-C standard provides many optional rules that can be included/excluded at the discretion of the implementer. Since I was not closely involved in the code development, I don't have insight to all of the decisions or explanations that were taken. For certain, there are comments within the code recognizing areas where exceptions are made in full knowledge of the potential risk (i.e., potential endless while loops, etc.) As a blanket statement, the code provided is MISRA-C compliant, but it may not comply with a specific optional rule you might choose to use vs. the TI development team's choice to exclude.

    In regard to applying MISRA-A rules to specific files, I don't know the full capabilities of CCS and would recommend you post that question separately as a CCS support question. However, I do think that it is possible to create a Make file with explicit build options for each file where you could possibly have MISRA-C checking only on the files you want.
  • Hi Rob,

    Note:

    Is the application targeting Safety Critical system ( SIL or ASIL ). The reason I ask is the tool you use for these type of static analysis must be certified for safety application. We for HALCoGen, Safety Library we use LDRA tool for all our Static Analysis ( MISRA and HIS Metric ). We do not recommend customer to use CCS for static Analysis for going for Safety critical application.

    Coming to your question, Hercules Software Team follows a MISRA policy document across all our Safety Software products. I can share it with you if needed, this has the details of what rules are checked and what are waived off and justified. Our software components include Header files from Compiler, so the errors in these header files are listed where ever they are used, typically the std_types type of header files. This can be taken and ignored or justified globally.

    Both HALCoGen and Safety Diagnostics Library comes with something called as Compliance Support Package( CSP) which has the artifacts like

    CSP is charged, since it packs the LDRA tool for running the tests. But there is a Demo verison which you can down load and have a look at the sample of below artifacts.

    CSP Artifacts
    Title Description
    Requirements and Design
    Software Safety Requirements specification This document contains software safety requirements specification for HALCoGen.
    Software Architecture Document This document describes the software architecture of HALCoGen.
    Design Document This document describes the software design of HALCoGen.
    TI FEE Design Document This document describes the software design of HALCoGen TI FEE driver.
    Test
    Detailed Static Analysis report This report provides summary of the Software quality metrics and the MISRA-C 2004 violations.
    Detailed Dynamic Analysis report This report provides summary of the Structural Coverage metrics (Statement,Branch,MC/DC Coverage metrics).
    Test Results This report provides detailed information about the results of the formal testing.
    Traceability Matrix This report provides the traceability matrix between different phases of software development.
    Manual
    Hercules Software Safety Manual This document is the software safety manual for HALCoGe
  • Hi

    Yes this application is for SIL.

    Any additional info you can provide will be appreciated.

    We will eventually invest in CSP but i would like to have the bulk of MISRA rules under control first.

    Still struggling with the volume of warnings generated (>10,000, down from almost 30,000) and some of the warnings i am stumped on how to correct.

    regards

    Rob