Menu

uninitvar false positive

2023-06-08
2023-06-08
  • Dotan Barak

    Dotan Barak - 2023-06-08

    Hi. Just updated to 2.10 (actually, I'm over the master) and found following false positive:

    /tmp/sample.c:6:47: error: Uninitialized variable: next_value [uninitvar]

    Here is a minimal sample that reproduces the issue:

    int main()
    {
            int i;
            int cur_value, next_value;
    
            for (i = 0; i < 10; i ++, cur_value = next_value) {
                    next_value = i;
            }
    
            return 0;
    }
    
     
  • CHR

    CHR - 2023-06-08

    Thanks for reporting, this is tracked in https://trac.cppcheck.net/ticket/11688

     

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.