Menu

Request: Promote MISRA checks to --enable=all

mcandre
2024-08-06
2025-01-17
  • mcandre

    mcandre - 2024-08-06

    The MISRA checks are more difficult to execute than most other cppcheck checks. For example, Stack Overflow recommends performing manual dumps, one per individual C/C++ source file:

    https://stackoverflow.com/a/49439561

    cppcheck --dump file.c
    python misra.py file.c.dump
    

    That breaks recursion for large C/C++ projects. It requires the user to manage the internals of the misra.py script, risking vendor locking a project's build environment to a specific cppcheck version or OS implementation.

    When I hand cppcheck the --enable=all option, I would expect it to run MISRA checks automatically. Can we please promote them to execute in the same pool as all other checks?

     
  • Daniel Marjamäki

    . For example, Stack Overflow recommends performing manual dumps, one per individual C/C++ source file:

    That is unfortunate I recommend that --addon=misra is used.

    I have an example for running misra in the manual:
    https://github.com/danmar/cppcheck/blob/main/man/manual.md#running-addons

    When I hand cppcheck the --enable=all option, I would expect it to run MISRA checks automatically.

    No it's by intention that you enable misra separately.

    The --enable=all should enable all the "core" cppcheck checkers. Checkers that we don't feel belong in Cppcheck because of philosophy can be added in addons. Misra philosophy is noisy therefore it does not belong in Cppcheck "core".

     
  • Daniel Marjamäki

    I am very sorry it took so long to reply to this.

     

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.