CppCoreGuidelines icon indicating copy to clipboard operation
CppCoreGuidelines copied to clipboard

Are profile names the only way of selecting multiple rules in a single `tag` inside `gsl::suppress`?

Open dmitrykobets-msft opened this issue 2 years ago • 2 comments

In.force: Enforcement currently specifies only 3 warning "groups", one for each of the 3 profiles: type, bounds, lifetime.

However, one might want to be more granular, for instance suppressing all warnings under a certain major section or subsection i.e., [[gsl::suppress(C)]] or [[gsl::suppress(C.ctor)]].

If this is accepted, then certain naming conventions should be cleaned up / standardized. Some examples:

  • Throughout the CG the C section rules are referred to simply like C.20 or C.160, even if they are in different subsections (C.20 is under C.ctor and C.160 is under C.over). In contrast, the SL major section rules always include the subsection (i.e., SL.io.4, SL.str.3, ...).
  • The ES family only has implicit(unnamed) subsections although these can probably be made explicit.
  • The C.1-C.9 rules aren't under any subsection, whereas the other C.* rules are under subsections.

dmitrykobets-msft avatar Feb 17 '23 20:02 dmitrykobets-msft

Editors call: We agree that this is a problem we have to solve, and we'll keep this issue open as we give it thought, including exploring finding good names for all sections and deciding whether to consistently embrace multi-level names.

hsutter avatar Jul 27 '23 16:07 hsutter

See also #2044

hsutter avatar Jul 27 '23 16:07 hsutter

Editors call: Yes, those three profile names are the only exceptions to that suppress must give a single rule number.

hsutter avatar Feb 15 '24 21:02 hsutter