aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-04 05:27:35 +0100
committereldritch horrors <pennae@lix.systems>2024-03-04 05:27:35 +0100
commit6e0dd9f6738f58749a9fe31cd0dfcf9fc10cdcfe (patch)
tree043b0ebc2c2f4bb6fe6d19e4c84ca8bef417c0a3 /src/libstore
parent2633ca3f883bb5f1bba7eb8a310cdf401680fe3b (diff)
Merge pull request #9289 from edolstra/fix-warnings
Fix gcc warnings (cherry picked from commit 66cb364f581486e0c426b35149ac13d19f7842bc) Change-Id: I1474dbc18a4beaaf1bce16d4abbcc99806b79ff1
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/derivations.cc5
-rw-r--r--src/libstore/store-api.cc2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index fc17e520c..7ea4d50e6 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -353,7 +353,7 @@ Derivation parseDerivation(
expect(str, "erive(");
version = DerivationATermVersion::Traditional;
break;
- case 'r':
+ case 'r': {
expect(str, "rvWithVersion(");
auto versionS = parseString(str);
if (versionS == "xp-dyn-drv") {
@@ -366,6 +366,9 @@ Derivation parseDerivation(
expect(str, ",");
break;
}
+ default:
+ throw Error("derivation does not start with 'Derive' or 'DrvWithVersion'");
+ }
/* Parse the list of outputs. */
expect(str, "[");
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index b15765b73..2851133d4 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -815,7 +815,7 @@ void Store::substitutePaths(const StorePathSet & paths)
std::vector<DerivedPath> paths2;
for (auto & path : paths)
if (!path.isDerivation())
- paths2.push_back(DerivedPath::Opaque{path});
+ paths2.emplace_back(DerivedPath::Opaque{path});
uint64_t downloadSize, narSize;
StorePathSet willBuild, willSubstitute, unknown;
queryMissing(paths2,