[cfe-commits] r107865 - in /cfe/trunk/include/clang/Basic: DiagnosticGroups.td DiagnosticParseKinds.td

Chandler Carruth chandlerc at gmail.com
Thu Jul 8 03:52:02 PDT 2010


Author: chandlerc
Date: Thu Jul  8 05:52:01 2010
New Revision: 107865

URL: http://llvm.org/viewvc/llvm-project?rev=107865&view=rev
Log:
Wrap the new ext-warn on extraneous comma on the last entry of an enumerator
list in a diagnostic group so it can be turned on and off. A terrifying amount
of code, including large chunks of open source code, still do this so it's
important to be able to suppress it when necessary.

Doug, is this a reasonable compromise? I'd lean toward making it a normal
extension, but I don't feel strongly as long as we can turn the warnings off.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=107865&r1=107864&r2=107865&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Thu Jul  8 05:52:01 2010
@@ -38,6 +38,7 @@
 def : DiagGroup<"discard-qual">;
 def : DiagGroup<"div-by-zero">;
 def EmptyBody : DiagGroup<"empty-body">;
+def EnumeratorListComma : DiagGroup<"enumerator-list-comma">;
 def ExtraTokens : DiagGroup<"extra-tokens">;
 
 def FormatExtraArgs : DiagGroup<"format-extra-args">;

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=107865&r1=107864&r2=107865&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Thu Jul  8 05:52:01 2010
@@ -53,7 +53,7 @@
   "compound literals are a C99-specific feature">;
 def ext_enumerator_list_comma : ExtWarn<
   "commas at the end of enumerator lists are a %select{C99|C++0x}0-specific "
-  "feature">;
+  "feature">, InGroup<EnumeratorListComma>;
 
 def ext_gnu_indirect_goto : Extension<
   "use of GNU indirect-goto extension">, InGroup<GNU>;





More information about the cfe-commits mailing list