diff options
-rw-r--r-- | include/clang/Basic/DiagnosticFrontendKinds.td | 3 | ||||
-rw-r--r-- | lib/Frontend/Warnings.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td index ae5246d792..9c439851b1 100644 --- a/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/include/clang/Basic/DiagnosticFrontendKinds.td @@ -136,4 +136,7 @@ def warn_pch_char_signed : Error< def err_not_a_pch_file : Error< "'%0' does not appear to be a precompiled header file">, DefaultFatal; +def warn_unknown_warning_option : Warning< + "unknown warning option '%0'">, + InGroup<DiagGroup<"unknown-warning-option"> >; } diff --git a/lib/Frontend/Warnings.cpp b/lib/Frontend/Warnings.cpp index 81f75bdf75..c8fd5f6fcb 100644 --- a/lib/Frontend/Warnings.cpp +++ b/lib/Frontend/Warnings.cpp @@ -24,6 +24,7 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Sema/SemaDiagnostic.h" #include "clang/Lex/LexDiagnostic.h" +#include "clang/Frontend/FrontendDiagnostic.h" #include <cstdio> #include <cstring> #include <utility> @@ -99,7 +100,8 @@ bool clang::ProcessWarningOptions(Diagnostic &Diags, } if (Diags.setDiagnosticGroupMapping(OptStart, Mapping)) - fprintf(stderr, "warning: unknown warning option: -W%s\n", Opt.c_str()); + Diags.Report(FullSourceLoc(), diag::warn_unknown_warning_option) + << ("-W" + Opt); } return false; |