[PATCH] D80751: [clang][diagnostics] Add '-Wundef-prefix' warning option

Juergen Ributzka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 8 10:30:21 PDT 2020


ributzka added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:475
+  Alias<Wundef_prefix_EQ>,
+  HelpText<"Aliased to '-Wundef-prefix=\"\"', enable warnings for undefined macros">;
 def Wwrite_strings : Flag<["-"], "Wwrite-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
----------------
We should provide a description that doesn't mention that this is an alias of `-Wundef-prefix`, because the alias is an implementation detail.


================
Comment at: clang/lib/Lex/PPExpressions.cpp:262
+          // string to UndefPrefixes as an explicit "-Wundef" does.
+          if (UndefPrefixes.empty() ||
+              llvm::any_of(UndefPrefixes,
----------------
What happens when you use `-Werror=undef` and `-Wundef-prefix=<arg>`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80751/new/

https://reviews.llvm.org/D80751





More information about the cfe-commits mailing list