From 1642db7b1197d15703b413b40b50db0f418cd8cc Mon Sep 17 00:00:00 2001 From: "J. Krieg" Date: Sun, 2 Sep 2018 21:21:03 +0200 Subject: [PATCH] src/gui-neutrino/lib/xmltree/xmlinterface.cpp: fix build when compiling with -Werror because with this the warning: warning: 'xmlgz_file' may be used uninitialized in this function [-Wmaybe-uninitialized] warning: 'xml_file' may be used uninitialized in this function [-Wmaybe-uninitialized] is treated as an error and the build aborts - so let's remove this warning... Thanks to Janus for reporting this and the suggested fix Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/13ab6e92a0b71127116be4758f655ca89191319f Author: J. Krieg Date: 2018-09-02 (Sun, 02 Sep 2018) Origin message was: ------------------ src/gui-neutrino/lib/xmltree/xmlinterface.cpp: fix build when compiling with -Werror because with this the warning: warning: 'xmlgz_file' may be used uninitialized in this function [-Wmaybe-uninitialized] warning: 'xml_file' may be used uninitialized in this function [-Wmaybe-uninitialized] is treated as an error and the build aborts - so let's remove this warning... Thanks to Janus for reporting this and the suggested fix Signed-off-by: Thilo Graf ------------------ This commit was generated by Migit --- lib/xmltree/xmlinterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xmltree/xmlinterface.cpp b/lib/xmltree/xmlinterface.cpp index da7213806..5cb64bc09 100644 --- a/lib/xmltree/xmlinterface.cpp +++ b/lib/xmltree/xmlinterface.cpp @@ -374,8 +374,8 @@ xmlDocPtr parseXmlFile(const char * filename, bool warning_by_nonexistence /* = XMLTreeParser* tree_parser; size_t done; size_t length; - FILE* xml_file; - gzFile xmlgz_file; + FILE* xml_file = NULL; + gzFile xmlgz_file = NULL; std::string fn = filename; bool zipped = (fn.substr(fn.find_last_of(".") + 1) == "gz");