Menu

Misra rules.txt file not applied to my source file

2022-02-11
2022-02-21
  • vipul kumar

    vipul kumar - 2022-02-11

    Hi,

    Thanks!

    I am using CPPCheck-2.6 GUI on windows. I tried creating "misra_rules.txt" out of "misra_C_2012.pdf" file using python script as per below. I could see .txt & .json file generated but they are empty.

    "python3 scripts/cppcheck-misra-parsetexts.py /path/to/MISRA_C_2012.pdf"

    As the script didn't work for me so, I copied Appendix A rules of MISRA_C_2012.pdf into text file manually. I added this file in addons but still not applied on source files. Attaching the generated rules.txt file for reference. What i am doing wrong here, please help me on this.

     
    • Daniel Marjamäki

      I removed the attachment we can't publish the rule texts. But at first look, the file looks correct..

       
  • Daniel Marjamäki

    Can you run on this code:

    static void bar(void)
    {
        uint16_t x = 2147483648;
    }
    

    Using your file that you attached I get a 10.3 warning and the proper rule text is written.

     
    • vipul kumar

      vipul kumar - 2022-02-14

      Hi Daniels,

      Thanks for the response!

      Tried the code you shared, still not getting warning message for misra. It could be possible, something wrong with my CPPCheck GUI project settings. I am attaching 2 reference images on Addon, any issue with respect to that. Expecting your response asap.

       
  • Daniel Marjamäki

    does it help if you activate these buttons in the toolbar

     
  • vipul kumar

    vipul kumar - 2022-02-14

    Hi Daniel,

    Thanks!

    All these buttons are already activated & i am getting warnings also. But looks like none of them belongs to MISRA, even after adding the code you shared. Attaching the report.

     
  • vipul kumar

    vipul kumar - 2022-02-15

    Hi Daniel,

    Thanks!

    Any further inputs from your end.

     
  • vipul kumar

    vipul kumar - 2022-02-21

    Hi Daniel,

    Thanks!

    I could use Misra rules txt with my source on linux command line. It working for me, could see the misra warnings & errors. Not sure what i missed on the GUI side(Windows). I will explore further on GUI also.

     
    • Daniel Marjamäki

      ok good there is progress. Really strange that it does not work in GUI then.

       

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.