From 753942df0c6c8711b064fe8710cdb05119730620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 26 Sep 2012 16:15:35 +0200 Subject: [PATCH] Revert "Fixed #4165 (False positive:(error) Uninitialized variable: here)" This reverts commit 96b1890797a5589a5f238a18298dbb30b072214e. --- lib/checkuninitvar.cpp | 2 +- test/testuninitvar.cpp | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index e3deb626a..6189c7581 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -1325,7 +1325,7 @@ bool CheckUninitVar::isVariableUsage(const Token *vartok, bool pointer) const return false; } - if (Token::Match(vartok->next(), "++|--|%op%") && !Token::simpleMatch(vartok->tokAt(-2), "( &")) + if (Token::Match(vartok->next(), "++|--|%op%")) return true; if (vartok->strAt(1) == "]") diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 6303a1092..9b6f85d51 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -2002,12 +2002,6 @@ private: "}"); ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: x\n", errout.str()); - checkUninitVar2("void f() {\n" // #4165 - fp when & is used as address-of in condition - " int x;\n" - " if (&x < p) { }\n" - "}"); - ASSERT_EQUALS("", errout.str()); - // ?: checkUninitVar2("int f(int *ptr) {\n" " int a;\n"