From 6ac2b6ab1474c96d9f8f4ea4d3f5bb24d6b0913d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 30 Oct 2009 15:23:27 +0100 Subject: [PATCH] uninitialized variables: return|goto are not used in variable declarations --- lib/checkother.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 68caacd93..89255d9a2 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1331,6 +1331,9 @@ void CheckOther::uninitvar() } if (Token::Match(tok, "[{};] %type% *| %var% ;")) { + if (Token::Match(tok->next(), "return|goto")) + continue; + // if it's a pointer, dereferencing is forbidden const bool pointer(tok->strAt(2) == std::string("*"));