From 5b21820a4ad0f69290c6a20643640ff5fbf5021a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 6 Feb 2024 04:51:48 +0200 Subject: Fix bunch of maybe used uninitialized warnings --- libbuild2/cc/common.cxx | 2 +- libbuild2/cc/pkgconfig.cxx | 3 ++- libbuild2/config/operation.cxx | 3 ++- libbuild2/file.cxx | 2 +- libbuild2/install/utility.cxx | 2 +- libbuild2/parser.cxx | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx index 7306274..44722c4 100644 --- a/libbuild2/cc/common.cxx +++ b/libbuild2/cc/common.cxx @@ -643,7 +643,7 @@ namespace build2 << " dependency " << *t << " is " << w << info << "mentioned in *.export." << (impl ? "impl_" : "") << "libs of target " << l << - info << "is it a prerequisite of " << l << "?"; + info << "is it a prerequisite of " << l << "?" << endf; } // Process it recursively. diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx index d8ccaad..046fbc8 100644 --- a/libbuild2/cc/pkgconfig.cxx +++ b/libbuild2/cc/pkgconfig.cxx @@ -2008,7 +2008,8 @@ namespace build2 } catch (const invalid_argument& e) { - fail << "invalid metadata version in library " << g << ": " << e; + fail << "invalid metadata version in library " << g << ": " << e + << endf; } if (ver != 1) diff --git a/libbuild2/config/operation.cxx b/libbuild2/config/operation.cxx index b06c29d..5983e4b 100644 --- a/libbuild2/config/operation.cxx +++ b/libbuild2/config/operation.cxx @@ -134,7 +134,8 @@ namespace build2 bool r; if (c.compare (p, 4 , "save") == 0) r = true; else if (c.compare (p, 4 , "drop") == 0) r = false; - else fail << "invalid config.config.persist action '" << c << "'"; + else fail << "invalid config.config.persist action '" << c << "'" + << endf; bool w (false); if ((p += 4) != c.size ()) diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx index 88f1a9b..0122889 100644 --- a/libbuild2/file.cxx +++ b/libbuild2/file.cxx @@ -3514,7 +3514,7 @@ namespace build2 catch (const invalid_argument& e) { fail (loc) << "invalid metadata version in imported target " << t - << ": " << e; + << ": " << e << endf; } if (ver != 1) diff --git a/libbuild2/install/utility.cxx b/libbuild2/install/utility.cxx index c8b6a92..43d97fb 100644 --- a/libbuild2/install/utility.cxx +++ b/libbuild2/install/utility.cxx @@ -98,7 +98,7 @@ namespace build2 v = false; else fail << "expected true or false instead of '" << string (s, 0, p) - << "' in config.install.filter value"; + << "' in config.install.filter value" << endf; if (p != string::npos) { diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index b695018..eb78059 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -8312,7 +8312,7 @@ namespace build2 // get the variable name even during pre-parse. It should also // be faster. // - char c; + char c ('\0'); if ((tt == type::word ? path_traits::rfind_separator (t.value) == string::npos : (c = special (t))) && -- cgit v1.1