[PATCH] D49114: [clang-tidy] Add a check for "magic numbers"
Eugene Zelenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 11 15:20:22 PDT 2018
Eugene.Zelenko added a comment.
In https://reviews.llvm.org/D49114#1159327, @0x8000-0000 wrote:
> In https://reviews.llvm.org/D49114#1159211, @Eugene.Zelenko wrote:
>
> > C++ Core Guidelines contains ES.45: Avoid "magic constants"; use symbolic constants <https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Res-magic>, so I think check should be moved into cppcoreguidelines module.
>
>
> The same guidelines existed in medical and aerospace environments for many years before C++ Core Guidelines. In fact the same checker should run just fine on C code (I'm not sure about Objective-C).
>
> I am not opposed to moving it, if this is where the consensus leads - I know where to find it :)
You could create aliases for other guidelines.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D49114
More information about the cfe-commits
mailing list