summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-05-24 16:36:03 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-05-25 12:05:00 +0200
commitc3bfdbfa3ae868515a67142d2df6200a3cb34d35 (patch)
tree241c4d6c2ddd3a4224cd5040537f47b6babb8149
parent90a7a5e32643a67f4245460e7659d9dee230e9e7 (diff)
Silence clang warning -Wstring-plus-int
../apt-pkg/init.cc:137:39: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] Cnf.CndSet("Dir::State", STATE_DIR + 1); ../apt-pkg/init.cc:137:39: note: use array indexing to silence this warning We have a few instances of that & it should be reasonably clear that we are not actually trying to append here, but ignoring or silencing this warning with an override is far more costly than just using what clang suggests here. Reported-By: clang Gbp-Dch: Ignore
-rw-r--r--apt-pkg/deb/debsystem.cc2
-rw-r--r--apt-pkg/init.cc8
2 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc
index 6904879b6..7d4bf7213 100644
--- a/apt-pkg/deb/debsystem.cc
+++ b/apt-pkg/deb/debsystem.cc
@@ -270,7 +270,7 @@ static std::string getDpkgStatusLocation(Configuration const &Cnf) {
Configuration PathCnf;
PathCnf.Set("Dir", Cnf.Find("Dir", "/"));
PathCnf.Set("Dir::State::status", "status");
- auto const cnfstatedir = Cnf.Find("Dir::State", STATE_DIR + 1);
+ auto const cnfstatedir = Cnf.Find("Dir::State", &STATE_DIR[1]);
// if the state dir ends in apt, replace it with dpkg -
// for the default this gives us the same as the fallback below.
// This can't be a ../dpkg as that would play bad with symlinks
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index a619368ec..b9d9b15d2 100644
--- a/apt-pkg/init.cc
+++ b/apt-pkg/init.cc
@@ -134,18 +134,18 @@ bool pkgInitConfig(Configuration &Cnf)
Cnf.CndSet("Dir","/");
// State
- Cnf.CndSet("Dir::State", STATE_DIR + 1);
+ Cnf.CndSet("Dir::State", &STATE_DIR[1]);
Cnf.CndSet("Dir::State::lists","lists/");
Cnf.CndSet("Dir::State::cdroms","cdroms.list");
// Cache
- Cnf.CndSet("Dir::Cache", CACHE_DIR + 1);
+ Cnf.CndSet("Dir::Cache", &CACHE_DIR[1]);
Cnf.CndSet("Dir::Cache::archives","archives/");
Cnf.CndSet("Dir::Cache::srcpkgcache","srcpkgcache.bin");
Cnf.CndSet("Dir::Cache::pkgcache","pkgcache.bin");
// Configuration
- Cnf.CndSet("Dir::Etc", CONF_DIR + 1);
+ Cnf.CndSet("Dir::Etc", &CONF_DIR[1]);
Cnf.CndSet("Dir::Etc::sourcelist","sources.list");
Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d");
Cnf.CndSet("Dir::Etc::main","apt.conf");
@@ -162,7 +162,7 @@ bool pkgInitConfig(Configuration &Cnf)
Cnf.CndSet("Dir::Media::MountPath","/media/apt");
// State
- Cnf.CndSet("Dir::Log", LOG_DIR + 1);
+ Cnf.CndSet("Dir::Log", &LOG_DIR[1]);
Cnf.CndSet("Dir::Log::Terminal","term.log");
Cnf.CndSet("Dir::Log::History","history.log");
Cnf.CndSet("Dir::Log::Planner","eipp.log.xz");