Menu

-checkers-report reports MISRA C is not enabled

2024-04-18
2024-05-22
  • shruti gupta

    shruti gupta - 2024-04-18

    when using cppcheck --addon=misra.json, checher report says MISRA C is not enabled
    even though it ran misra checks, generated error xml.

     
  • Daniel Marjamäki

    Yeah it did not work well in latest release. It's fixed in Cppcheck HEAD and will be released soon.

     
  • Jonathan Mullen

    Jonathan Mullen - 2024-05-17

    I am seeing the same issue in v2.15.0 dev built directly from source on the main branch of github

     

    Last edit: Jonathan Mullen 2024-05-17
    • Daniel Marjamäki

      If I do this with latest HEAD:

      echo "x=1;" > test1.c
      cppcheck --addon=misra --enable=style --checkers-report=report.txt test1.c
      

      I get this output in the report.txt:

      Misra C 2012
      ------------
      Yes  Misra C 2012: 1.1
      Yes  Misra C 2012: 1.2
      Yes  Misra C 2012: 1.3
      Yes  Misra C 2012: 1.4     amendment:2
      No   Misra C 2012: 1.5     amendment:3 require:premium
      Yes  Misra C 2012: 2.1
      Yes  Misra C 2012: 2.2
      Yes  Misra C 2012: 2.3
      Yes  Misra C 2012: 2.4
      Yes  Misra C 2012: 2.5
      Yes  Misra C 2012: 2.6
      Yes  Misra C 2012: 2.7
      Yes  Misra C 2012: 2.8
      

      amendment 3 and 4 are not covered in open source Cppcheck they are covered in premium.

       
      • Jonathan Mullen

        Jonathan Mullen - 2024-05-20

        So that works for me, but the following do not:

        echo "x=1;" > test1.c
        cppcheck --addon=misra.py --enable=style --checkers-report=report.txt test1.c
        

        2.

        echo "x=1;" > test1.c
        cppcheck --addon=misra.json --enable=style --checkers-report=report.txt test1.c
        

        with json file contents:

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

        3.

        echo "x=1;" > test1.c
        cppcheck --addon=misra.json --enable=style --checkers-report=report.txt test1.c
        

        with json file contents:

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

        In all these 3 cases I see:

        Misra C
        -------
        Misra is not enabled
        

        So it seems that it is not fixed if the addon is specified via a json file or with the .py suffix

         

        Last edit: Jonathan Mullen 2024-05-20
        • Daniel Marjamäki

          Thanks for reporting this bug. I created ticket https://trac.cppcheck.net/ticket/12751

           
          👍
          1

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.