aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-10-27 16:32:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-10-27 16:32:08 +0200
commit5bf2dd09110f257acc730eab71301e1dede1c710 (patch)
tree291da1bd5a9aac4cdb50efe0c4884bebf75e4d82
parent758b66cf9ce32c44b37cd7e2c65b71d89c0240bf (diff)
Suppress (potential) bogus GCC 12 -Wrestrict warnings
-rw-r--r--libbrep/build.cxx4
-rw-r--r--libbrep/common.cxx2
-rw-r--r--libbrep/package.cxx14
-rw-r--r--load/load.cxx2
-rw-r--r--migrate/migrate.cxx4
-rw-r--r--mod/database.cxx2
-rw-r--r--mod/external-handler.cxx2
-rw-r--r--mod/mod-build-log.cxx2
-rw-r--r--mod/mod-build-task.cxx2
-rw-r--r--mod/mod-ci.cxx2
-rw-r--r--mod/mod-package-version-details.cxx6
-rw-r--r--mod/mod-repository-details.cxx2
-rw-r--r--mod/mod-submit.cxx2
-rw-r--r--tests/load/driver.cxx2
-rw-r--r--web/server/apache/request.cxx2
-rw-r--r--web/server/apache/service.cxx2
16 files changed, 26 insertions, 26 deletions
diff --git a/libbrep/build.cxx b/libbrep/build.cxx
index 03775c4..c095b32 100644
--- a/libbrep/build.cxx
+++ b/libbrep/build.cxx
@@ -24,7 +24,7 @@ namespace brep
{
if (s == "building") return build_state::building;
else if (s == "built") return build_state::built;
- else throw invalid_argument ("invalid build state '" + s + "'");
+ else throw invalid_argument ("invalid build state '" + s + '\'');
}
// force_state
@@ -48,7 +48,7 @@ namespace brep
if (s == "unforced") return force_state::unforced;
else if (s == "forcing") return force_state::forcing;
else if (s == "forced") return force_state::forced;
- else throw invalid_argument ("invalid force state '" + s + "'");
+ else throw invalid_argument ("invalid force state '" + s + '\'');
}
// build
diff --git a/libbrep/common.cxx b/libbrep/common.cxx
index 8964e0a..4f729a3 100644
--- a/libbrep/common.cxx
+++ b/libbrep/common.cxx
@@ -30,6 +30,6 @@ namespace brep
else if (r == "test") return unbuildable_reason::test;
else if (r == "external") return unbuildable_reason::external;
else if (r == "unbuildable") return unbuildable_reason::unbuildable;
- else throw invalid_argument ("invalid unbuildable reason '" + r + "'");
+ else throw invalid_argument ("invalid unbuildable reason '" + r + '\'');
}
}
diff --git a/libbrep/package.cxx b/libbrep/package.cxx
index 65fa1ba..5f99fbb 100644
--- a/libbrep/package.cxx
+++ b/libbrep/package.cxx
@@ -161,11 +161,11 @@ namespace brep
// Probably drop-box would be better as also tells what are
// the available internal repositories.
//
- string k (project.string () + " " + name.string () + " " +
- version.string () + " " + version.string (true));
+ string k (project.string () + ' ' + name.string () + ' ' +
+ version.string () + ' ' + version.string (true));
if (upstream_version)
- k += " " + *upstream_version;
+ k += ' ' + *upstream_version;
// Add licenses to search keywords.
//
@@ -173,13 +173,13 @@ namespace brep
{
for (const auto& l: la)
{
- k += " " + l;
+ k += ' ' + l;
// If license is say LGPLv2 then LGPL is also a search keyword.
//
size_t n (l.size ());
if (n > 2 && l[n - 2] == 'v' && l[n - 1] >= '0' && l[n - 1] <= '9')
- k += " " + string (l, 0, n - 2);
+ k += ' ' + string (l, 0, n - 2);
}
}
@@ -190,12 +190,12 @@ namespace brep
// Add topics to the second-strongest search keywords.
//
for (const auto& t: topics)
- k2 += " " + t;
+ k2 += ' ' + t;
// Add keywords to the second-strongest search keywords.
//
for (const auto& k: keywords)
- k2 += " " + k;
+ k2 += ' ' + k;
return {move (k), move (k2), description ? *description : "", changes};
}
diff --git a/load/load.cxx b/load/load.cxx
index 691afb6..760ce28 100644
--- a/load/load.cxx
+++ b/load/load.cxx
@@ -262,7 +262,7 @@ load_repositories (path p)
bad_line ("invalid buildable option value");
}
else
- bad_line ("invalid option '" + nv + "'");
+ bad_line ("invalid option '" + nv + '\'');
}
// For now cache option is mandatory.
diff --git a/migrate/migrate.cxx b/migrate/migrate.cxx
index 172c374..090fcac 100644
--- a/migrate/migrate.cxx
+++ b/migrate/migrate.cxx
@@ -115,7 +115,7 @@ schema (const char* s, string name)
string kw;
i >> kw;
- statement += " " + kw;
+ statement += ' ' + kw;
if (strcasecmp (kw.c_str (), "FUNCTION") == 0)
{
@@ -133,7 +133,7 @@ schema (const char* s, string name)
else if (strcasecmp (kw.c_str (), "FOREIGN") == 0)
{
i >> kw;
- statement += " " + kw;
+ statement += ' ' + kw;
valid = strcasecmp (kw.c_str (), "TABLE") == 0;
// Fall through.
diff --git a/mod/database.cxx b/mod/database.cxx
index d53ee50..c88555a 100644
--- a/mod/database.cxx
+++ b/mod/database.cxx
@@ -59,7 +59,7 @@ namespace brep
// Change the connection current user to the execution user name.
//
if (!role_.empty ())
- conn->execute ("SET ROLE '" + role_ + "'");
+ conn->execute ("SET ROLE '" + role_ + '\'');
return conn;
}
diff --git a/mod/external-handler.cxx b/mod/external-handler.cxx
index cdf3f71..dc4c0fd 100644
--- a/mod/external-handler.cxx
+++ b/mod/external-handler.cxx
@@ -316,7 +316,7 @@ namespace brep
assert (e != nullptr);
if (!(*e == '\0' && c >= 100 && c < 600))
- bad_value ("invalid HTTP status '" + v + "'");
+ bad_value ("invalid HTTP status '" + v + '\'');
// Save the HTTP status.
//
diff --git a/mod/mod-build-log.cxx b/mod/mod-build-log.cxx
index 948c9c3..328d178 100644
--- a/mod/mod-build-log.cxx
+++ b/mod/mod-build-log.cxx
@@ -196,7 +196,7 @@ handle (request& rq, response& rs)
auto config_expired = [&trace, &lpath, this] (const string& d)
{
l2 ([&]{trace << "package build configuration for " << lpath
- << (!tenant.empty () ? "(" + tenant + ")" : "")
+ << (!tenant.empty () ? '(' + tenant + ')' : "")
<< " expired: " << d;});
throw invalid_request (404, "package build configuration expired: " + d);
diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx
index 137cf6a..5ba6d06 100644
--- a/mod/mod-build-task.cxx
+++ b/mod/mod-build-task.cxx
@@ -534,7 +534,7 @@ handle (request& rq, response& rs)
}
if (!lc)
- throw invalid_request (400, "unable to match login info '" + l + "'");
+ throw invalid_request (400, "unable to match login info '" + l + '\'');
tqm.interactive_login = move (lc);
}
diff --git a/mod/mod-ci.cxx b/mod/mod-ci.cxx
index ac69941..68bb9be 100644
--- a/mod/mod-ci.cxx
+++ b/mod/mod-ci.cxx
@@ -653,7 +653,7 @@ handle (request& rq, response& rs)
},
2 /* stderr */,
options_->email (),
- "CI request submission (" + request_id + ")",
+ "CI request submission (" + request_id + ')',
{options_->ci_email ()});
// Write the CI request manifest.
diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx
index 8ea0b01..37eb3c6 100644
--- a/mod/mod-package-version-details.cxx
+++ b/mod/mod-package-version-details.cxx
@@ -152,7 +152,7 @@ handle (request& rq, response& rs)
const string& name (pkg->name.string ());
- const string title (name + " " + sver);
+ const string title (name + ' ' + sver);
xml::serializer s (rs.content (), title);
s << HTML
@@ -220,7 +220,7 @@ handle (request& rq, response& rs)
{
assert (pkg->location);
- s << TR_LINK (rl.url ().string () + "/" + pkg->location->string (),
+ s << TR_LINK (rl.url ().string () + '/' + pkg->location->string (),
pkg->location->leaf ().string (),
"download");
}
@@ -292,7 +292,7 @@ handle (request& rq, response& rs)
if (dcon)
s << ' '
- << A(HREF=u + "/" + p->version.string ()) << *dcon << ~A;
+ << A(HREF=u + '/' + p->version.string ()) << *dcon << ~A;
}
else if (p->internal ())
{
diff --git a/mod/mod-repository-details.cxx b/mod/mod-repository-details.cxx
index ce7582e..1cbb5cb 100644
--- a/mod/mod-repository-details.cxx
+++ b/mod/mod-repository-details.cxx
@@ -100,7 +100,7 @@ handle (request& rq, response& rs)
//
string id (html_id (r.canonical_name));
s << H1(ID=id)
- << A(HREF="#" + web::mime_url_encode (id, false))
+ << A(HREF='#' + web::mime_url_encode (id, false))
<< r.display_name
<< ~A
<< ~H1;
diff --git a/mod/mod-submit.cxx b/mod/mod-submit.cxx
index 2ad8661..b73c96e 100644
--- a/mod/mod-submit.cxx
+++ b/mod/mod-submit.cxx
@@ -683,7 +683,7 @@ handle (request& rq, response& rs)
sendmail sm (print_args,
2 /* stderr */,
options_->email (),
- "new package submission " + a.string () + " (" + ref + ")",
+ "new package submission " + a.string () + " (" + ref + ')',
{options_->submit_email ()});
// Write the submission request manifest.
diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx
index 727f054..05efd15 100644
--- a/tests/load/driver.cxx
+++ b/tests/load/driver.cxx
@@ -39,7 +39,7 @@ check_location (shared_ptr<package>& p)
{
if (p->internal ())
return p->location && *p->location ==
- path (p->name.string () + "-" + p->version.string () + ".tar.gz");
+ path (p->name.string () + '-' + p->version.string () + ".tar.gz");
else
return !p->location;
}
diff --git a/web/server/apache/request.cxx b/web/server/apache/request.cxx
index 64e1e6d..f6e9f15 100644
--- a/web/server/apache/request.cxx
+++ b/web/server/apache/request.cxx
@@ -789,7 +789,7 @@ namespace web
if (is != nullptr)
{
if (r != nullptr)
- throw invalid_argument ("multiple uploads for '" + name + "'");
+ throw invalid_argument ("multiple uploads for '" + name + '\'');
r = is;
}
diff --git a/web/server/apache/service.cxx b/web/server/apache/service.cxx
index af5873e..6d02c1a 100644
--- a/web/server/apache/service.cxx
+++ b/web/server/apache/service.cxx
@@ -47,7 +47,7 @@ namespace web
for (const auto& o: od)
{
auto i (
- option_descriptions_.emplace (name_ + "-" + o.first, o.second));
+ option_descriptions_.emplace (name_ + '-' + o.first, o.second));
assert (i.second);
*d++ =