From: Marcin Siodelski Date: Wed, 19 Dec 2012 16:14:21 +0000 (+0100) Subject: [2544] Silence the false positive reported by cppcheck. X-Git-Tag: bind10-1.0.0-beta-release~2^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f64ff7004ddec6c81538b2fc5d6827de6b79cfb8;p=thirdparty%2Fkea.git [2544] Silence the false positive reported by cppcheck. The cppcheck seems to have difficulty to figure out that the variable is set and initialized within a loop and that it is read within another loop iteration. --- diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc index b88cdcc4df..3dd75d7296 100644 --- a/src/bin/dhcp4/tests/config_parser_unittest.cc +++ b/src/bin/dhcp4/tests/config_parser_unittest.cc @@ -131,6 +131,7 @@ public: if (!first) { stream << ", "; } else { + // cppcheck-suppress unreadVariable first = false; } if (param.first == "name") { diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc index 1440338069..812eb680ff 100644 --- a/src/bin/dhcp6/tests/config_parser_unittest.cc +++ b/src/bin/dhcp6/tests/config_parser_unittest.cc @@ -97,6 +97,7 @@ public: if (!first) { stream << ", "; } else { + // cppcheck-suppress unreadVariable first = false; } if (param.first == "name") {