[PATCH] D49114: [clang-tidy] Add a check for "magic numbers"

Florin Iucha via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 11 15:19:05 PDT 2018


0x8000-0000 added a comment.

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 :)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49114





More information about the cfe-commits mailing list