aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-21 10:16:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-21 10:16:53 +0200
commit7bbbe76637ae5b9733c608c596f1468dd5e27a06 (patch)
tree27f462311b222f926aad2efd08357944b66adc0e /libbuild2
parentd882a627e0c1c90f49a2a1f69273aafc5ebfb520 (diff)
Work around bogus -Wrestrict in GCC 12 (GCC bug #105329)
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/script/run.cxx10
-rw-r--r--libbuild2/utility.cxx4
2 files changed, 10 insertions, 4 deletions
diff --git a/libbuild2/script/run.cxx b/libbuild2/script/run.cxx
index fa6067e..8b609f1 100644
--- a/libbuild2/script/run.cxx
+++ b/libbuild2/script/run.cxx
@@ -1429,7 +1429,10 @@ namespace build2
// number (start from one) in the script.
//
if (li > 0)
- p += "-" + to_string (li);
+ {
+ p += '-';
+ p += to_string (li);
+ }
// 0 if belongs to a single-command expression, otherwise is the
// command number (start from one) in the expression.
@@ -1439,7 +1442,10 @@ namespace build2
// script. These cases are mutually exclusive and so are unambiguous.
//
if (ci > 0)
- p += "-" + to_string (ci);
+ {
+ p += '-';
+ p += to_string (ci);
+ }
return normalize (move (p), temp_dir (env), ll);
};
diff --git a/libbuild2/utility.cxx b/libbuild2/utility.cxx
index 31be3aa..3eeeeaa 100644
--- a/libbuild2/utility.cxx
+++ b/libbuild2/utility.cxx
@@ -131,13 +131,13 @@ namespace build2
if (p.absolute ())
{
if (p == b)
- return cur ? "." + p.separator_string () : string ();
+ return cur ? '.' + p.separator_string () : string ();
#ifndef _WIN32
if (!home.empty ())
{
if (p == home)
- return "~" + p.separator_string ();
+ return '~' + p.separator_string ();
}
#endif