Menu

Failed to execute addon 'misra' - exitcode is 1

vix
2026-01-07
2026-01-12
  • vix

    vix - 2026-01-07

    I run cppcheck 2.19 from the GUI on Windows and I created a project file (*.cppcheck).

    I enabled Addons >> Coding standards >> MISRA C 2012 ...
    The file with MISRA rules starts in this way:

    Appendix A Summary of guidelines
    
    Rule 1.1 Required
    Any implementation-defined behaviour on which the output of the
    program depends shall be documented and understood
    
    -------------------------------------------------------------------------------
    Rule 2.1 Required
    All source files shall compile without any compilation errors
    Requirements traceability
    

    When I run the analysis I get the following error:

    Id: internalError
    Bailing out from analysis: Checking file failed: Failed to execute addon 'misra' - exitcode is 1: python.exe "C:\Program Files\Cppcheck\addons\runaddon.py" "C:\Program Files\Cppcheck\addons\misra.py" --cli --rule-texts=D:/repos/..../misra_rules_2012.txt D:\repos\..\xxxxx-cppcheck-build-dir\main.a1.dump
    Output:
    
    Traceback (most recent call last):
      File "C:\Program Files\Cppcheck\addons\runaddon.py", line 12, in <module>
        runpy.run_path(addon, run_name='__main__')
        ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<frozen runpy>", line 287, in run_path
      File "<frozen runpy>", line 98, in _run_module_code
      File "<frozen runpy>", line 88, in _run_code
      File "C:\Program Files\Cppcheck\addons\misra.py", line 5152, in <module>
        main()
        ~~~~^^
      File "C:\Program Files\Cppcheck\addons\misra.py", line 5063, in main
        checker.loadRuleTexts(filename)
        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
      File "C:\Program Files\Cppcheck\addons\misra.py", line 4598, in loadRuleTexts
        self.ruleTexts[rule.num].text += ' ' + line.strip()
        ~~~~~~~~~~~~~~^^^^^^^^^^
    KeyError: 406
    

    Is there something wrong in my misra rule file?

     
  • vix

    vix - 2026-01-12

    should I provide any additional info on this error?

     

Log in to post a comment.