Hello,
I guess I found false positive warning related short circuit logic behavior. Look at the following code please. It seems that cppcheck don't tke in account b is initialized anyway in left part of the expression.
b
class A { public: A() { valid = false; value = false; } bool get(bool& v) const { v = value; return valid; } void set(bool v) { value = v; valid = true; } private: bool value; bool valid; }; int main() { A a; a.set(true); // cppcheck says b is uninitialized bool b = a.get(b) && b; // cppcheck says nothing bool c; bool isOk = a.get(c) && c; return !isOk; }
No repro with 2.3.
Log in to post a comment.
Hello,
I guess I found false positive warning related short circuit logic behavior.
Look at the following code please. It seems that cppcheck don't tke in account
bis initialized anyway in left part of the expression.No repro with 2.3.