Checkers:VA_UNUSED.INIT

From current

Reference > C/C++ checkers > VA UNUSED.INIT

The value assigned to a variable in initialization is never used, until the next assignment or the end of the function.

Example 1

1  int foo(){
2    int i = f();
3  
4    i = g();
5    return i;
6  }

'i' is initialized with value returned from function f(), but this value is never used.

Related checkers

External guidance