summaryrefslogtreecommitdiffstats
path: root/Utilities/cmjsoncpp
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-29 12:31:59 (GMT)
committerBrad King <brad.king@kitware.com>2017-08-30 14:17:17 (GMT)
commit1a2b62b189365061056497b4a9fdc73cde7e91ed (patch)
tree61a8f7b63a0e316db8e76e5d3bd79b1b502998a2 /Utilities/cmjsoncpp
parentc103a959d12e810bb3eb8a8f155a171944d6a1ea (diff)
downloadCMake-1a2b62b189365061056497b4a9fdc73cde7e91ed.zip
CMake-1a2b62b189365061056497b4a9fdc73cde7e91ed.tar.gz
CMake-1a2b62b189365061056497b4a9fdc73cde7e91ed.tar.bz2
jsoncpp: Add initialization to pacify scanbuild
The scanbuild analysis cannot see that decodeUnicodeEscapeSequence either initializes the `unicode` argument or returns `false` such that the code following it runs only if `unicode` is initialized. Add an explicit initialization to pacify it.
Diffstat (limited to 'Utilities/cmjsoncpp')
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_reader.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
index 0886dab..0249cc9 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
@@ -1728,6 +1728,7 @@ bool OurReader::decodeUnicodeCodePoint(Token& token,
Location end,
unsigned int& unicode) {
+ unicode = 0; // Convince scanbuild this is always initialized before use.
if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
return false;
if (unicode >= 0xD800 && unicode <= 0xDBFF) {