From 3d17415c4672348d0892e71b15d850a66f95a095 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Mon, 5 Dec 2011 11:53:33 -0800 Subject: disable the 'unused parameter' warning It was firing too often, and hadn't uncovered any bugs. --- configure.py | 5 ++++- src/browse.cc | 2 +- src/build.cc | 2 +- src/build_test.cc | 2 +- src/disk_interface_test.cc | 6 +++--- src/graph.cc | 4 ++-- src/ninja.cc | 2 +- src/subprocess.cc | 2 +- src/test.cc | 2 +- 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/configure.py b/configure.py index fbcdeb3..ef4bec1 100755 --- a/configure.py +++ b/configure.py @@ -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'] diff --git a/src/browse.cc b/src/browse.cc index 2e74206..bab3f36 100644 --- a/src/browse.cc +++ b/src/browse.cc @@ -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.) diff --git a/src/build.cc b/src/build.cc index 25d3ba9..bb73f7d 100644 --- a/src/build.cc +++ b/src/build.cc @@ -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; diff --git a/src/build_test.cc b/src/build_test.cc index 6beb976..0d4dce6 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -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; diff --git a/src/disk_interface_test.cc b/src/disk_interface_test.cc index 30fa4ca..107726b 100644 --- a/src/disk_interface_test.cc +++ b/src/disk_interface_test.cc @@ -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; } diff --git a/src/graph.cc b/src/graph.cc index 2cdba80..d881280 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -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; } diff --git a/src/ninja.cc b/src/ninja.cc index 8125c98..a46980e 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -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::iterator i = state->rules_.begin(); i != state->rules_.end(); ++i) { if (i->second->description_.unparsed_.empty()) { diff --git a/src/subprocess.cc b/src/subprocess.cc index da93b1f..74eded0 100644 --- a/src/subprocess.cc +++ b/src/subprocess.cc @@ -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)); diff --git a/src/test.cc b/src/test.cc index 24b68f6..719cec3 100644 --- a/src/test.cc +++ b/src/test.cc @@ -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()) -- cgit v0.12