From 8d503017f7fdb54fb6b522e0415751d7e172662f Mon Sep 17 00:00:00 2001 From: Shinichiro Hamaji Date: Fri, 3 Jul 2015 16:26:15 +0900 Subject: [C++] Suppress warnings --- dep.cc | 2 +- eval.cc | 1 + exec.cc | 2 +- log.h | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dep.cc b/dep.cc index 7416774..9657a8a 100644 --- a/dep.cc +++ b/dep.cc @@ -399,7 +399,7 @@ class DepBuilder { return rule.get(); } - DepNode* BuildPlan(Symbol output, Symbol needed_by) { + DepNode* BuildPlan(Symbol output, Symbol needed_by UNUSED) { LOG("BuildPlan: %s for %s", output.c_str(), needed_by.c_str()); diff --git a/eval.cc b/eval.cc index 69339e4..a93d307 100644 --- a/eval.cc +++ b/eval.cc @@ -199,6 +199,7 @@ void Evaluator::EvalIf(const IfAST* ast) { } default: CHECK(false); + abort(); } const vector* asts; diff --git a/exec.cc b/exec.cc index 056318e..c5b7b19 100644 --- a/exec.cc +++ b/exec.cc @@ -44,7 +44,7 @@ class Executor { : ce_(ev) { } - void ExecNode(DepNode* n, DepNode* needed_by) { + void ExecNode(DepNode* n, DepNode* needed_by UNUSED) { if (done_[n->output]) return; done_[n->output] = true; diff --git a/log.h b/log.h index c230217..702af1b 100644 --- a/log.h +++ b/log.h @@ -28,6 +28,9 @@ using namespace std; extern bool g_log_no_exit; extern string* g_last_error; +// Useful for logging-only arguments. +#define UNUSED __attribute__((unused)) + #ifdef NOLOG #define LOG(args...) #else -- cgit v1.2.3