diff --git a/src/libstore/build-result.hh b/src/libstore/build-result.hh index 8840fa7e3..3636ad3a4 100644 --- a/src/libstore/build-result.hh +++ b/src/libstore/build-result.hh @@ -123,6 +123,11 @@ struct KeyedBuildResult : BuildResult * The derivation we built or the store path we substituted. */ DerivedPath path; + + // Hack to work around a gcc "may be used uninitialized" warning. + KeyedBuildResult(BuildResult res, DerivedPath path) + : BuildResult(std::move(res)), path(std::move(path)) + { } }; } diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index a9b8de123..c7a658361 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -2480,6 +2480,7 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs() CanonPath { tmpDir + "/tmp" }).hash; } } + assert(false); }(); ValidPathInfo newInfo0 { diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index e1337f51d..917813342 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -415,6 +415,8 @@ static void performOp(TunnelLogger * logger, ref store, // Use NAR; Git is not a serialization method dumpMethod = FileSerialisationMethod::Recursive; break; + default: + assert(false); } // TODO these two steps are essentially RemoteStore::addCAToStore. Move it up to Store. auto path = store->addToStoreFromDump(source, name, dumpMethod, contentAddressMethod, hashAlgo, refs, repair); diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 8dfe8adda..09196481b 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -527,6 +527,8 @@ StorePath RemoteStore::addToStoreFromDump( // Use NAR; Git is not a serialization method fsm = FileSerialisationMethod::Recursive; break; + default: + assert(false); } if (fsm != dumpMethod) unsupported("RemoteStore::addToStoreFromDump doesn't support this `dumpMethod` `hashMethod` combination"); diff --git a/src/libutil/file-content-address.cc b/src/libutil/file-content-address.cc index 471bda6a0..570247b9e 100644 --- a/src/libutil/file-content-address.cc +++ b/src/libutil/file-content-address.cc @@ -123,7 +123,7 @@ Hash hashPath( case FileIngestionMethod::Git: return git::dumpHash(ht, accessor, path, filter).hash; } - + assert(false); } }