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

Florin Iucha via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 9 18:36:08 PDT 2018


0x8000-0000 added a comment.

Perhaps M_PI wasn't the best example, as its value won't change soon, but other numbers should be defined in relation to constants.

Also I have seen coding guidelines suggesting "100" is grandfathered due to 100% calculations. 2 and 10 due to logarithms, etc. Not sure where to draw the line there.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49114





More information about the cfe-commits mailing list