Menu

MISRA cppcheck annalysis fail

Adrian
2021-08-17
2021-08-18
  • Adrian

    Adrian - 2021-08-17

    Hi, I am trying to run misra addons with cppcheck for a GitHub Workflow and keep getting a number of errors.

    I used the commands:

    cppcheck --force --inline-suppr --quiet . 2> bundle_cppcheck_err.txt
    cppcheck --dump misra-test.h --std=c89
    cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra-test.c --std=c89 --platform=unix64
    python3 misra.py -verify misra-test.c.dump

    The output is:

    17[misra-test.c:1789]: (error) Buffer is accessed out of bounds.
    18[misra-test.c:932]: (error) Analysis failed. If the code is valid then please report this failure.
    19Traceback (most recent call last):
    20 File "misra.py", line 4486, in <module>
    21 main()
    22 File "misra.py", line 4428, in main
    23 checker.parseDump(item)
    24 File "misra.py", line 4042, in parseDump
    25 for conf in data.configurations:
    26 File "/home/runner/work/cFS-JSF-Rules/cFS-JSF-Rules/cppcheckdata.py", line 1029, in configurations
    27 return list(self.iterconfigurations())
    28 File "/home/runner/work/cFS-JSF-Rules/cFS-JSF-Rules/cppcheckdata.py", line 1057, in iterconfigurations
    29 cfg.setIdMap(cfg_arguments)
    30 File "/home/runner/work/cFS-JSF-Rules/cFS-JSF-Rules/cppcheckdata.py", line 864, in setIdMap
    31 self.set_id_map(functions_arguments)
    25 File "/home/runner/work/cFS-JSF-Rules/cFS-JSF-Rules/cppcheckdata.py", line 853, in set_id_map
    26 function.setId(IdMap)
    27 File "/home/runner/work/cFS-JSF-Rules/cFS-JSF-Rules/cppcheckdata.py", line 547, in setId
    28 self.argument[argnr] = IdMap[argid]
    29KeyError: '0x55ec19d8c460'
    30Error: Process completed with exit code 1.</module>

    Here is the workflow: https://github.com/ArielSAdamsNASA/cFS-JSF-Rules/runs/3352551313?check_suite_focus=true

    Anyone know how to fix these errors?

     
  • Daniel Marjamäki

    Can you see if there is a version mismatch. For instance, if you installed cppcheck then you must use the installed misra addon you can't use latest misra addon from github.

     

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.