From ccdef45a2a5af30f897c107062e5939c3be4371f Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Sat, 19 Nov 2011 20:22:42 +0100 Subject: Remove warning triggered by -Wextra on MinGW. --- src/build.cc | 2 ++ src/ninja.cc | 4 ++++ src/subprocess-win32.cc | 2 +- src/util.cc | 3 ++- src/util.h | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/build.cc b/src/build.cc index 332a70f..1686eed 100644 --- a/src/build.cc +++ b/src/build.cc @@ -163,6 +163,8 @@ void BuildStatus::PrintStatus(Edge* edge) { } } } +#else + NINJA_UNUSED_ARG(progress_chars); #endif printf("%s", to_print.c_str()); diff --git a/src/ninja.cc b/src/ninja.cc index 6034f87..8125c98 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -247,6 +247,10 @@ int CmdBrowse(State* state, const char* ninja_command, } RunBrowsePython(state, ninja_command, argv[0]); #else + NINJA_UNUSED_ARG(state); + NINJA_UNUSED_ARG(ninja_command); + NINJA_UNUSED_ARG(argc); + NINJA_UNUSED_ARG(argv); Error("browse mode not yet supported on Windows"); #endif // If we get here, the browse failed. diff --git a/src/subprocess-win32.cc b/src/subprocess-win32.cc index 6e5ebab..f331337 100644 --- a/src/subprocess-win32.cc +++ b/src/subprocess-win32.cc @@ -90,7 +90,7 @@ HANDLE Subprocess::SetupPipe(HANDLE ioport) { bool Subprocess::Start(SubprocessSet* set, const string& command) { HANDLE child_pipe = SetupPipe(set->ioport_); - STARTUPINFOA startup_info = {}; + STARTUPINFOA startup_info; startup_info.cb = sizeof(STARTUPINFO); startup_info.dwFlags = STARTF_USESTDHANDLES; startup_info.hStdOutput = child_pipe; diff --git a/src/util.cc b/src/util.cc index 0bbcaf2..e8cd11e 100644 --- a/src/util.cc +++ b/src/util.cc @@ -173,7 +173,8 @@ void SetCloseOnExec(int fd) { #else // On Windows, handles must be explicitly marked to be passed to a // spawned process, so there's nothing to do here. -#endif // WIN32 + NINJA_UNUSED_ARG(fd); +#endif // ! _WIN32 } int64_t GetTimeMillis() { diff --git a/src/util.h b/src/util.h index 40b519e..d36e2e1 100644 --- a/src/util.h +++ b/src/util.h @@ -21,6 +21,8 @@ #include using namespace std; +#define NINJA_UNUSED_ARG(arg_name) (void)arg_name; + /// Log a fatal message and exit. void Fatal(const char* msg, ...); -- cgit v0.12