[cfe-commits] r50633 - /cfe/trunk/Driver/clang.cpp
Chris Lattner
sabre at nondot.org
Sun May 4 16:52:03 PDT 2008
Author: lattner
Date: Sun May 4 18:52:02 2008
New Revision: 50633
URL: http://llvm.org/viewvc/llvm-project?rev=50633&view=rev
Log:
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.
Modified:
cfe/trunk/Driver/clang.cpp
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=50633&r1=50632&r2=50633&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Sun May 4 18:52:02 2008
@@ -500,6 +500,15 @@
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);
+ }
}
//===----------------------------------------------------------------------===//
More information about the cfe-commits
mailing list