[PATCH] D53817: [clang-tidy] cppcoreguidelines-macro-usage: print macro names

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 29 10:28:15 PDT 2018


JonasToth added a comment.

> I personally haven't yet seen this check firing on *predefined* macros.

I did specifically check the compiler defined macros I could see in the AST and they were not diagnosed from the beginning.
I would guess, only the compiler-flag macros are passed in the PPCallbacks, which would explain the current behaviour.

> The only problem i have are these command-line-based macros.
>  They *may* be outside of programmer's control, but if one has access to the buildsystem
>  (as in, not *just* to the source code to be compiled, but to the build system definitions
>  that say *how* to build it), then one can easily add such command-line-based macros.

It is a burden with little to gain as they the toggle-stuff use-case is not replaceable with other constructs.
Having it as opt-in might be ok, but by default the check should not diagnose them.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53817





More information about the cfe-commits mailing list