Menu

Cppcheck-2.5

2021-05-22
2021-11-16
<< < 1 2 3 (Page 3 of 3)
  • Georgiy Komarov

    Georgiy Komarov - 2021-07-05

    I also checked the official MISRA forum and found two related threads:
    https://www.misra.org.uk/forum/viewtopic.php?f=223&t=1288
    https://www.misra.org.uk/forum/viewtopic.php?f=223&t=1669
    These cases are incompatible. But they don't explain why.

     
    • Richard Smith

      Richard Smith - 2021-07-07

      Yeah.. I don't understand why those are not ok. Seems reasonable to me that the checker could not consider those violations. The end result is the same.

       
  • Richard Smith

    Richard Smith - 2021-06-29
     

    Last edit: Richard Smith 2021-06-30
  • CHR

    CHR - 2021-07-02

    Using release-windows #431, I'm getting apparently random/hard to reproduce crashes. I realize this is not very specific, but maybe someone else is also seeing this?

     
    • Daniel Marjamäki

      hmm.. the daca@home show that there are some crashes but it has not escalated a lot. but if you can provide a example code that is very interesting..

       
  • Daniel Marjamäki

    For information.. I have started the release process and would like to release tomorrow..

    feel free to complain if you think there are still blockers that means we should delay the release further..

     
  • Absol

    Absol - 2021-08-20

    include <iostream></iostream>

    void f(int * main)
    {
    int test[1];
    test[0] = main[5];
    std::cout << test[0];
    }

    int main()
    {
    int * test2 = new int[1];
    test2[0] = 5;
    f(test2);
    }

    No error about main[5] is uninitialized memory.
    And this is not cause error in 90% cases. http://cpp.sh/2xq7t

     
    • Daniel Marjamäki

      It is not uninitialized memory. It is buffer overrun. This is a regression. We used to detect this. cppcheck-1.87 says:

      [1.cpp:12] -> [1.cpp:4]: (error) Array '[1]' accessed at index 5, which is out of bounds.
      

      not sure where it was lost but it was before cppcheck-2.2

       
      😕
      1

      Last edit: Daniel Marjamäki 2021-08-20
      • Daniel Marjamäki

        Thanks for reporting this! I have created https://trac.cppcheck.net/ticket/10415

         
        • Absol

          Absol - 2021-08-20

          Thanks!

           

          Last edit: Absol 2021-08-24
        • Absol

          Absol - 2021-08-24

          clear

           

          Last edit: Absol 2021-08-24
  • Absol

    Absol - 2021-08-20

    Someone can add detection for this error ?

     
  • Absol

    Absol - 2021-08-20

    I founs new problem or this is regression too?

    #include <iostream>
    
    int main()
    {
        char *p = new char[256];
        p = &p[255];
        p[0] = 'x';
        p[10] = 'x';
        std::cout << p;
    }
    
     
  • Absol

    Absol - 2021-08-20

    this is compiled and executed without error, but cause error?)))

     
  • Absol

    Absol - 2021-08-22

    impossible to fix it and add new detection ?

     
    • Daniel Marjamäki

      sorry .. I have the feeling there could be a related ticket already and wanted to look but then didn't have time to look. I create a new ticket anyway: https://trac.cppcheck.net/ticket/10422

       
      • Absol

        Absol - 2021-08-23

        I know it exists https://trac.cppcheck.net/ticket/10415. I writing about new problem

        #include <iostream>
        
        int main()
        {
            char *p = new char[256];
            p = &p[255];
            p[0] = 'x';
            p[10] = 'x';
            std::cout << p;
        }
        

        It not detected as code mistake

         
        • Daniel Marjamäki

          could you open a new forum. I don't see this discussion as related to the cppcheck-2.5 release. but I took that code and simplified it and created https://trac.cppcheck.net/ticket/10422 so there is a ticket already.

           
  • Absol

    Absol - 2021-08-23

    yes I write about this problem, thanks

     
<< < 1 2 3 (Page 3 of 3)

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.