diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2011-11-19 15:13:48 (GMT) |
---|---|---|
committer | Nicolas Despres <nicolas.despres@gmail.com> | 2011-11-19 18:35:32 (GMT) |
commit | 73b24b00cc670b2f879d1468fac3670158e42255 (patch) | |
tree | d58e1868ece7dc25cc6629034a1b84a4c94fa9e7 | |
parent | 68c5917bf994d7e32b30a5b6df4bbda0189a4017 (diff) | |
download | Ninja-73b24b00cc670b2f879d1468fac3670158e42255.zip Ninja-73b24b00cc670b2f879d1468fac3670158e42255.tar.gz Ninja-73b24b00cc670b2f879d1468fac3670158e42255.tar.bz2 |
Add -Wextra warning flag.
Fix triggered warnings:
- unused parameter
- type qualifiers ignored on function return type
- missing initializer for member
-rwxr-xr-x | configure.py | 2 | ||||
-rw-r--r-- | src/browse.cc | 2 | ||||
-rw-r--r-- | src/build.cc | 2 | ||||
-rw-r--r-- | src/eval_env.h | 2 | ||||
-rw-r--r-- | src/ninja.cc | 4 | ||||
-rw-r--r-- | 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<string, const Rule*>::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)); |