diff options
author | Chris Lattner <sabre@nondot.org> | 2008-05-04 23:52:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-05-04 23:52:02 +0000 |
commit | 8aedf199e986fffd4372cc9106e32f19709d7e87 (patch) | |
tree | f6822268dc5131119060d4b6d5b1007761f01b2f /Driver/clang.cpp | |
parent | 019ef7e1024562f9647d80ded7be8b8c1d23678a (diff) |
Fix PR2281: these two warnings should be promoted to error on
pedantic error. Perhaps I should add a class of 'extension' that is
'extension that warns by default', which would be cleaner.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50633 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/clang.cpp')
-rw-r--r-- | Driver/clang.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 62f570f627..e7dacc44fd 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -500,6 +500,15 @@ static void InitializeDiagnostics(Diagnostic &Diags) { if (MSExtensions) // MS allows unnamed struct/union fields. Diags.setDiagnosticMapping(diag::w_no_declarators, diag::MAP_IGNORE); + + // If -pedantic-errors is set, turn extensions that warn by default into + // errors. + if (ErrorOnExtensions) { + Diags.setDiagnosticMapping(diag::warn_hex_escape_too_large, + diag::MAP_ERROR); + Diags.setDiagnosticMapping(diag::warn_octal_escape_too_large, + diag::MAP_ERROR); + } } //===----------------------------------------------------------------------===// |