aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2020-12-01 14:57:56 +0100
committerregnat <rg@regnat.ovh>2020-12-01 15:04:03 +0100
commit438977731cf049cf47873d5825456d47a1aac541 (patch)
tree3636db99c851ff572d5dad6f656a5ec195dc7489
parent88798613ee288c7a801dcc1e73723a10a385df38 (diff)
shut up clang warnings
- Fix some class/struct discrepancies - Explicit the overloading of `run` in the `Cmd*` classes - Ignore a warning in the generated lexer
-rw-r--r--src/libexpr/lexer.l2
-rw-r--r--src/libstore/build/goal.hh2
-rw-r--r--src/libstore/build/worker.hh4
-rw-r--r--src/libstore/local-store.hh4
-rw-r--r--src/nix/run.cc8
5 files changed, 15 insertions, 5 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index f6e83926b..225ab3287 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -12,6 +12,8 @@
%{
+#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
+
#include <boost/lexical_cast.hpp>
#include "nixexpr.hh"
diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh
index 0781a9d38..fca4f2d00 100644
--- a/src/libstore/build/goal.hh
+++ b/src/libstore/build/goal.hh
@@ -7,7 +7,7 @@ namespace nix {
/* Forward definition. */
struct Goal;
-struct Worker;
+class Worker;
/* A pointer to a goal. */
typedef std::shared_ptr<Goal> GoalPtr;
diff --git a/src/libstore/build/worker.hh b/src/libstore/build/worker.hh
index 3a53a8def..bf8cc4586 100644
--- a/src/libstore/build/worker.hh
+++ b/src/libstore/build/worker.hh
@@ -8,8 +8,8 @@
namespace nix {
/* Forward definition. */
-class DerivationGoal;
-class SubstitutionGoal;
+struct DerivationGoal;
+struct SubstitutionGoal;
/* Workaround for not being able to declare a something like
diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh
index d4435220d..58ec93f27 100644
--- a/src/libstore/local-store.hh
+++ b/src/libstore/local-store.hh
@@ -296,8 +296,8 @@ private:
void createUser(const std::string & userName, uid_t userId) override;
- friend class DerivationGoal;
- friend class SubstitutionGoal;
+ friend struct DerivationGoal;
+ friend struct SubstitutionGoal;
};
diff --git a/src/nix/run.cc b/src/nix/run.cc
index 790784382..92a52c6cd 100644
--- a/src/nix/run.cc
+++ b/src/nix/run.cc
@@ -22,6 +22,9 @@ std::string chrootHelperName = "__run_in_chroot";
struct RunCommon : virtual Command
{
+
+ using Command::run;
+
void runProgram(ref<Store> store,
const std::string & program,
const Strings & args)
@@ -59,6 +62,9 @@ struct RunCommon : virtual Command
struct CmdShell : InstallablesCommand, RunCommon, MixEnvironment
{
+
+ using InstallablesCommand::run;
+
std::vector<std::string> command = { getEnv("SHELL").value_or("bash") };
CmdShell()
@@ -144,6 +150,8 @@ static auto rCmdShell = registerCommand<CmdShell>("shell");
struct CmdRun : InstallableCommand, RunCommon
{
+ using InstallableCommand::run;
+
std::vector<std::string> args;
CmdRun()