disable the 'unused parameter' warning
authorEvan Martin <martine@danga.com>
Mon, 5 Dec 2011 19:53:33 +0000 (11:53 -0800)
committerEvan Martin <martine@danga.com>
Mon, 5 Dec 2011 20:59:38 +0000 (12:59 -0800)
It was firing too often, and hadn't uncovered any bugs.

configure.py
src/browse.cc
src/build.cc
src/build_test.cc
src/disk_interface_test.cc
src/graph.cc
src/ninja.cc
src/subprocess.cc
src/test.cc

index fbcdeb3..ef4bec1 100755 (executable)
@@ -74,7 +74,10 @@ n.variable('builddir', 'build')
 n.variable('cxx', os.environ.get('CXX', 'g++'))
 n.variable('ar', os.environ.get('AR', 'ar'))
 
-cflags = ['-g', '-Wall', '-Wextra', '-Wno-deprecated', '-fno-exceptions',
+cflags = ['-g', '-Wall', '-Wextra',
+          '-Wno-deprecated',
+          '-Wno-unused-parameter',
+          '-fno-exceptions',
           '-fvisibility=hidden', '-pipe']
 if not options.debug:
     cflags += ['-O2', '-DNDEBUG']
index 2e74206..bab3f36 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "../build/browse_py.h"
 
-void RunBrowsePython(State* /* state */, const char* ninja_command,
+void RunBrowsePython(State* state, const char* ninja_command,
                      const char* initial_target) {
   // Fork off a Python process and have it run our code via its stdin.
   // (Actually the Python process becomes the parent.)
index 25d3ba9..bb73f7d 100644 (file)
@@ -421,7 +421,7 @@ struct DryRunCommandRunner : public CommandRunner {
     finished_.push(edge);
     return true;
   }
-  virtual Edge* WaitForCommand(bool* success, string* /* output */) {
+  virtual Edge* WaitForCommand(bool* success, string* output) {
     if (finished_.empty())
       return NULL;
     *success = true;
index 6beb976..0d4dce6 100644 (file)
@@ -251,7 +251,7 @@ bool BuildTest::StartCommand(Edge* edge) {
   return true;
 }
 
-Edge* BuildTest::WaitForCommand(bool* success, string* /* output */) {
+Edge* BuildTest::WaitForCommand(bool* success, string* output) {
   if (Edge* edge = last_command_) {
     if (edge->rule_->name_ == "fail")
       *success = false;
index 30fa4ca..107726b 100644 (file)
@@ -163,15 +163,15 @@ struct StatTest : public StateTestWithBuiltinRules,
                   public DiskInterface {
   // DiskInterface implementation.
   virtual int Stat(const string& path);
-  virtual bool MakeDir(const string& /* path */) {
+  virtual bool MakeDir(const string& path) {
     assert(false);
     return false;
   }
-  virtual string ReadFile(const string& /* path */, string* /* err */) {
+  virtual string ReadFile(const string& path, string* err) {
     assert(false);
     return "";
   }
-  virtual int RemoveFile(const string& /* path */) {
+  virtual int RemoveFile(const string& path) {
     assert(false);
     return 0;
   }
index 2cdba80..d881280 100644 (file)
@@ -203,8 +203,8 @@ bool Edge::LoadDepFile(State* state, DiskInterface* disk_interface,
   // Check that this depfile matches our output.
   StringPiece opath = StringPiece(outputs_[0]->file_->path_);
   if (opath != makefile.out_) {
-    *err = "expected makefile to mention '" + outputs_[0]->file_->path_ + "', "
-        "got '" + makefile.out_.AsString() + "'";
+    *err = "expected depfile '" + path + "' to mention '" +
+      outputs_[0]->file_->path_ + "', got '" + makefile.out_.AsString() + "'";
     return false;
   }
 
index 8125c98..a46980e 100644 (file)
@@ -367,7 +367,7 @@ int CmdTargets(State* state, int argc, char* argv[]) {
   }
 }
 
-int CmdRules(State* state, int /* argc */, char* /* argv */[]) {
+int CmdRules(State* state, int argc, char* /* argv */[]) {
   for (map<string, const Rule*>::iterator i = state->rules_.begin();
        i != state->rules_.end(); ++i) {
     if (i->second->description_.unparsed_.empty()) {
index da93b1f..74eded0 100644 (file)
@@ -37,7 +37,7 @@ Subprocess::~Subprocess() {
     Finish();
 }
 
-bool Subprocess::Start(SubprocessSet* /* set */, const string& command) {
+bool Subprocess::Start(SubprocessSet* set, const string& command) {
   int output_pipe[2];
   if (pipe(output_pipe) < 0)
     Fatal("pipe: %s", strerror(errno));
index 24b68f6..719cec3 100644 (file)
@@ -51,7 +51,7 @@ bool VirtualFileSystem::MakeDir(const string& path) {
   return true;  // success
 }
 
-string VirtualFileSystem::ReadFile(const string& path, string* /* err */) {
+string VirtualFileSystem::ReadFile(const string& path, string* err) {
   files_read_.push_back(path);
   FileMap::iterator i = files_.find(path);
   if (i != files_.end())