[PATCH] D134831: [Clang][Sema] Add -Wcast-function-type-strict

Sami Tolvanen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 16:00:20 PDT 2022


samitolvanen added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8686
+def warn_cast_function_type_strict : Warning<warn_cast_function_type.Text>,
+  InGroup<CastFunctionTypeStrict>, DefaultIgnore;
 def err_cast_pointer_to_non_pointer_int : Error<
----------------
nickdesaulniers wrote:
> I don't think we need a new group for a warning that only contains one diagnostic kind?
> I don't think we need a new group for a warning that only contains one diagnostic kind?

I might have misunderstood something, but we seem to have plenty of groups with only one diagnostic kind. Is there a way to add a new warning flag without adding a diagnostic group? Most users of `-Wcast-function-type` wouldn't want to enable the stricter version, so I would prefer to keep this separate.

I did notice that some warnings don't define the group in DiagnosticGroups.td, but specify it directly here. For example, `InGroup<DiagGroup<"argument-outside-range">>`. I'm not sure if there are any benefits in doing so.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134831



More information about the cfe-commits mailing list