From 7bbbe76637ae5b9733c608c596f1468dd5e27a06 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Apr 2022 10:16:53 +0200 Subject: Work around bogus -Wrestrict in GCC 12 (GCC bug #105329) --- libbuild2/script/run.cxx | 10 ++++++++-- libbuild2/utility.cxx | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'libbuild2') 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 -- cgit v1.1