summaryrefslogtreecommitdiffstats
path: root/clang/Driver/clang.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-04 23:52:02 +0000
committerChris Lattner <sabre@nondot.org>2008-05-04 23:52:02 +0000
commitde977c0a5c01403a20d9e55d4067cd1f67a6730d (patch)
tree5f0323a19d112df6fd256cf7cc3eb42ae2c70422 /clang/Driver/clang.cpp
parentca671b0e5144910731d9ff266a60c8b37dfee8b1 (diff)
downloadbcm5719-llvm-de977c0a5c01403a20d9e55d4067cd1f67a6730d.tar.gz
bcm5719-llvm-de977c0a5c01403a20d9e55d4067cd1f67a6730d.zip
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. llvm-svn: 50633
Diffstat (limited to 'clang/Driver/clang.cpp')
-rw-r--r--clang/Driver/clang.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp
index 62f570f6277..e7dacc44fd4 100644
--- a/clang/Driver/clang.cpp
+++ b/clang/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);
+ }
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud