From 73b24b00cc670b2f879d1468fac3670158e42255 Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Sat, 19 Nov 2011 16:13:48 +0100 Subject: Add -Wextra warning flag. Fix triggered warnings: - unused parameter - type qualifiers ignored on function return type - missing initializer for member --- configure.py | 2 +- src/browse.cc | 2 +- src/build.cc | 2 +- src/eval_env.h | 2 +- src/ninja.cc | 4 ++-- src/subprocess.cc | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.py b/configure.py index 16db729..e31387e 100755 --- a/configure.py +++ b/configure.py @@ -74,7 +74,7 @@ def cxx(name, **kwargs): n.variable('builddir', 'build') -cflags = ['-g', '-Wall', '-Wno-deprecated', '-fno-exceptions', +cflags = ['-g', '-Wall', '-Wextra', '-Wno-deprecated', '-fno-exceptions', '-fvisibility=hidden', '-pipe'] if not options.debug: cflags += ['-O2', '-DNDEBUG'] diff --git a/src/browse.cc b/src/browse.cc index bab3f36..2e74206 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 9465532..332a70f 100644 --- a/src/build.cc +++ b/src/build.cc @@ -419,7 +419,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/eval_env.h b/src/eval_env.h index 37f7b07..ed7c2f4 100644 --- a/src/eval_env.h +++ b/src/eval_env.h @@ -45,7 +45,7 @@ struct EvalString { string Evaluate(Env* env) const; const string& unparsed() const { return unparsed_; } - const bool empty() const { return unparsed_.empty(); } + bool empty() const { return unparsed_.empty(); } string unparsed_; enum TokenType { RAW, SPECIAL }; diff --git a/src/ninja.cc b/src/ninja.cc index 9c0a90f..6034f87 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -363,7 +363,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()) { @@ -459,7 +459,7 @@ int main(int argc, char** argv) { const option kLongOptions[] = { { "help", no_argument, NULL, 'h' }, - { } + { NULL, 0, NULL, 0 } }; int opt; diff --git a/src/subprocess.cc b/src/subprocess.cc index 74eded0..da93b1f 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)); -- cgit v0.12