[PATCH] Put macro redefinition warnings under -Wmacro-redefined

Reid Kleckner rnk at google.com
Thu Apr 3 17:16:03 PDT 2014


  Thanks!


================
Comment at: include/clang/Basic/DiagnosticGroups.td:51-52
@@ -50,3 +50,4 @@
 def BadArrayNewLength : DiagGroup<"bad-array-new-length">;
+def MacroRedefined : DiagGroup<"macro-redefined">;
 def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">;
 def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
----------------
Richard Smith wrote:
> Do you think there's value in making `BuiltinMacroRedefined` a subgroup of `MacroRedefined`? I'm torn here -- logically one is a subset of the other, but redefining a builtin macro is a more serious offense.
I'd leave it as is.  No need to impose artificial hierarchy.  Users might accidentally suppress -Wbuiltin-macro-redefined with -Wno-macro-redefined.


http://llvm-reviews.chandlerc.com/D3283

BRANCH
  macro-redef

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list