Menu

Use MISRA rules from the GUI?

2017-12-07
2021-06-13
<< < 1 .. 4 5 6 (Page 6 of 6)
  • Bassam Abdul-Baki

    Change the Misra path to not have spaces in it. It doesn't work with spaces.

     
    • Georgiy Komarov

      Georgiy Komarov - 2021-06-04

      I can't reproduce. cppcheck-gui (built from commit
      6a19313
      with Qt 5.15.2) handles paths with spaces without any errors on my Linux machine.

      cppcheck-gui starts QProcess with the required command that can contains file path with spaces as arguments. Under the hood, on Windows, Qt processes arguments to add quotes to each one that contains space symbols.

      So, I believe, all should work as expected. However, I don't have a Windows machine for the tests yet.

       

      Last edit: Georgiy Komarov 2021-06-04
  • Shobana Devi Sampath

    Am I missing anything in settings or the path.

    should the directory don't have any spaces - like program Files has space in the name ?

     
  • Shobana Devi Sampath

    C:/CppCheck/addons/MisraRules.txt - I'm using this path without spaces now. Still no luck :(

    Should I have any compiler installed ?

    int main()
    {
    char a[10];
    a[10] = 0;
    return 0;
    }

    I have just stored these lines of code with C extension and running to find the misra errors.
    Thank you very much for your support.

     
    • Georgiy Komarov

      Georgiy Komarov - 2021-06-04

      Does cppcheck-gui runs the checks at all? Do you see any messages in Analysis log tab?

      Have you tried to check the source file containing MISRA violations?
      For example, this one:

      int foo(int unused)
      {
          return 19;
      }
      
      int main(int argc, char *argv[])
      {
          ++*(int*)0;
          return foo(42);
      }
      

      Should I have any compiler installed ?

      No, you don't need any compiler installed to run cppcheck.

       

      Last edit: Georgiy Komarov 2021-06-04
      • Shobana Devi Sampath

        Kindly see the pic in the attachment

        On Fri, Jun 4, 2021 at 10:28 AM Georgiy Komarov
        jubnzv@users.sourceforge.net wrote:

        Does cppcheck-gui runs the checks at all? Do you see any messages in Analysis log tab?

        Have you tried to check the source file containing MISRA violations?
        For example, this one:

        int foo(int unused)
        {
        return 19;
        }

        int main(int argc, char argv[])
        {
        ++
        (int*)0;
        return foo(42);
        }

        Should I have any compiler installed ?

        No, you don't need any compiler to run cppcheck.


        Use MISRA rules from the GUI?


        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/cppcheck/discussion/general/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

        --

        Regards
        Shobana

         
  • Shobana Devi Sampath

    All the check is enabled. I have tried the same code snippet. Kindly check the attachment.

     
    • Georgiy Komarov

      Georgiy Komarov - 2021-06-04

      Hmm, strange.
      Do you have the MISRA addon enabled? You can check this on File -> Edit Project File... -> Addons tab.

       
  • Shobana Devi Sampath

    Hi ,

    I didn't create a project file. I was directly trying to analyse the C file. After I added created the project file and edited the addons tab, I'm able to see the misra warnings.

    Thank you very much for your support.

     
    👍
    1
  • pasding chu

    pasding chu - 2021-06-07

    how to support MISRA C 2012 Amendment1 additional security?

     
    • Georgiy Komarov

      Georgiy Komarov - 2021-06-07

      The MISRA addon doesn't support Amedment1 additional security rules.

      But Cppcheck already has checks for some of the rules described in this document (see orbitcowboy's comment on your question on github).

      So, answering your question, to support additional rules, they need to be implemented in MISRA addon. But you can find some violations using Cppcheck itself.

      I'm just wondering, why do you need them for? As far as I know, if you want to certify your software (for example, for SIL compatibility), it is sufficient to use a set of rules from the MISRA document itself without any additions.

       

      Last edit: Georgiy Komarov 2021-06-07
    • Daniel Marjamäki

      For information, I can't promise anything but I do believe cppcheck and its addon will handle all MISRA C 2012 rules later this year, including the extra amendment rules.

       
<< < 1 .. 4 5 6 (Page 6 of 6)

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.