Menu

misra rules check and txt files

2021-11-12
2021-11-14
  • Simone Gasparella

    I am trying the free version of Cppcheck (using version 2.6) ,
    I tried to run the following command for checking the misra rules in a particular c file ..

    python misra.py --rule-texts=misra_rules_dummy.txt inverter.c

    but I got this ... (view in the attachments)

    Any idea about what could be ?

    Please let me know

    Thanks

     

    Last edit: Simone Gasparella 2021-11-12
  • Daniel Marjamäki

    Hello!

    The misra addon runs its analysis on a cppcheck dump file (xml format).

    I'd recommend that you run addons using --addon:

    cppcheck --addon=misra.json inverter.c
    

    To load the proper rule texts file, create a misra.json file with this text:

    {
       "script": "misra",
       "args": [ "--rule-texts=misra_rules_dummy.txt" ]
    }
    

    If you do not like --addon you can create the dump file manually and run the misra script directly:

    cppcheck --dump inverter.c
    python misra.py --rule-texts=misra_rules_dummy.txt inverter.c.dump
    
     
  • Simone Gasparella

    Hello Daniel... Thanks for writing..
    With your suggestions now it works...

    thanks a lot

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.