Skip to content

Instantly share code, notes, and snippets.

@dileks
Created April 12, 2011 09:18
Show Gist options
  • Select an option

  • Save dileks/915224 to your computer and use it in GitHub Desktop.

Select an option

Save dileks/915224 to your computer and use it in GitHub Desktop.
Whuzz up with... -Wno-unused-arguments and -Werror-unused-arguments
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 78720ed..7b6beb1 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -1026,10 +1026,10 @@ void Driver::BuildJobs(Compilation &C) const {
II);
}
- // If the user passed -Qunused-arguments or there were errors, don't warn
+ // If the user passed -Wno-unused-arguments or there were errors, don't warn
// about any unused arguments.
if (Diags.hasErrorOccurred() ||
- C.getArgs().hasArg(options::OPT_Qunused_arguments))
+ C.getArgs().hasArg(options::OPT_Wno_unused_arguments))
return;
// Claim -### here.
@@ -1063,8 +1063,13 @@ void Driver::BuildJobs(Compilation &C) const {
continue;
}
- Diag(clang::diag::warn_drv_unused_argument)
- << A->getAsString(C.getArgs());
+ if (C.getArgs().hasArg(options::OPT_Werror_unused_arguments)) {
+ Diag(clang::diag::err_drv_unused_argument)
+ << A->getAsString(C.getArgs());
+ }
+ else
+ Diag(clang::diag::warn_drv_unused_argument)
+ << A->getAsString(C.getArgs());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment