Menu

Revisiting old tickets

CHR
2021-01-15
2021-02-18
1 2 > >> (Page 1 of 2)
  • CHR

    CHR - 2021-01-15

    So I've been looking at some old tickets marked as false positives. All examples were run with --enable=all --inconclusive. At least five tickets no longer reproduce with the current version.

    Ticket# Repro 1.87 Repro 2.3 Comment
    6081 no no
    6259 yes yes
    6342 yes no
    6477 yes yes can be avoided by setting ptr = 0 after delete
    6552 yes yes wacky overloaded >>= with side effects
    6572 yes yes
    6809 no no
    7013 yes no
    7334 yes yes
    7366 yes yes
    7459 yes yes
    7622 yes yes arguably not a FP
    7739 yes yes
    7754 yes yes
    7768 yes yes
    7948 yes yes
    7954 yes yes
    7959 yes yes arguably not a FP
    8000 yes no
     
  • Daniel Marjamäki

    6342: the "analysis failed" is not reported anymore however the debug output is not good.

     
  • Daniel Marjamäki

    7013: thanks! I closed that.

     
  • Daniel Marjamäki

    8000: thanks! I closed that

     
  • Daniel Marjamäki

    6809: hmm.. amai said he could reproduce on windows but not on linux. did you try it on windows also?

     
  • CHR

    CHR - 2021-01-16

    6809: Here is what I get on Windows 64bit, which seems correct. The original complaint was about requires 'ssize_t' but the argument type is 'ssize_t'.
    Code:

    void main(void) {
        ssize_t n = -1;
        printf("%zd", n); // should be allowed, like zu for size_t, gcc accepts it but cppcheck doesn't
        printf("%ld", n); // acceptable to both cppcheck and gcc
    }
    
    #include <stdio.h>
    int main2(void) {
        ssize_t n = -1;
        size_t x = 2;
        printf("%ld \n", n);
        printf("%zd \n", n);
    
        printf("%lu \n", x);
        printf("%zu \n", x);
        return 0;
    }
    

    Output:

    Checking 6809.cpp ...
    [6809.cpp:4]: (portability) %ld in format string (no. 1) requires 'long' but the argument type is 'ssize_t {aka signed long long}'.
    [6809.cpp:11]: (portability) %ld in format string (no. 1) requires 'long' but the argument type is 'ssize_t {aka signed long long}'.
    [6809.cpp:14]: (portability) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'size_t {aka unsigned long long}'.
    [6809.cpp:8]: (style) The function 'main2' is never used.
    (information) Cppcheck cannot find all the include files (use --check-config for details)
    
     
    • Daniel Marjamäki

      thanks! I have closed 6809

       
  • CHR

    CHR - 2021-01-16

    Tickets 8215, 8805 and 8909 also don't reproduce for me with either v1.87 or v2.3.

     

    Last edit: CHR 2021-01-16
    • Daniel Marjamäki

      8215: I can reproduce if file extension is .c . I have the feeling that the evaluation order is defined since c++11.

       
    • Daniel Marjamäki

      thanks! I can reproduce 8909 when file extension is .c. Not sure why that makes a difference.

       
      • CHR

        CHR - 2021-01-17

        Hmm, I must have overlooked the file extension on some of the code snippets.

         
    • CHR

      CHR - 2021-01-19

      8805 has been closed by @amai.

       
  • CHR

    CHR - 2021-01-16

    Tickets 8094, 8227, 8526, 8942, 8961, 9026 and 9223 reproduce with v1.87, but not with v2.3.
    Edited for typo: 8904 -> 8094

     

    Last edit: CHR 2021-01-19
    • Daniel Marjamäki

      thanks! I closed 9223

       
    • Daniel Marjamäki

      thanks! I closed 8961

       
    • CHR

      CHR - 2021-01-22

      It seems I was wrong about 8227, it still reproduces after all.

       
  • Daniel Marjamäki

    I closed 9026

     
  • CHR

    CHR - 2021-01-18

    9937 no longer reproduces with 2.3.

     
  • CHR

    CHR - 2021-01-22

    Just a reminder: 9937, 8094, 8526, and 6081 are still open.

     
    • Daniel Marjamäki

      I closed 8094

       
    • Daniel Marjamäki

      I closed 8526

       
    • Daniel Marjamäki

      6081 was closed by amai

       
  • Daniel Marjamäki

    Thanks I have closed 9937

     
  • CHR

    CHR - 2021-01-23

    Thanks for your efforts :-)

     
  • CHR

    CHR - 2021-02-03

    I just noticed that 8742 no longer reproduces with head (at least the original example, the modified one still does).

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.